我的系統:XP + python27 編解碼器, XP GBK;蟒蛇27 ASCII如何讓我的角色?
>>> a = '你好'
>>> a
'\xc4\xe3\xba\xc3'
>>> print a
你好
>>> '\xc4\xe3\xba\xc3'.decode('gbk')
u'\u4f60\u597d'
>>> '\xc4\xe3\xba\xc3'.encode('gbk')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal
not in range(128)
我怎樣才能得到 「你好」 從 '\ XC4 \ XE3 \ XBA \ XC3'?
你能在擴展question.language等? – Damien