Fix UTF-8 strings, set encoding