在蟒蛇中:
u'\u3053\n'
是 utf-16 吗?
我并不真正了解所有 unicode/encoding 的东西,但是这种类型的东西正在我的数据集中出现,就像我有a=u'\u3053\n'
.
print
给出异常,解码给出异常。
a.encode("utf-16") > '\xff\xfeS0\n\x00'
a.encode("utf-8") > '\xe3\x81\x93\n'
print a.encode("utf-8") > πüô
print a.encode("utf-16") > ■S0
这里发生了什么?