Fix unicodeEncode bug