fix utf8/utf16 strings