fix utf8/utf16 charsets