Make sure we're only dealing with UTF-8 when unencoding.

Closes #154.