Fix UTF16toUTF8 boundary bug