. , escape-. .. '\ u4e2a' 20010 (0x4e2a - ), "个".
. 8- , , . , . , , - ASCII , escape- (..\xb8 - 184 ( 0xB8 )). (gb2312) [184, 246] ('\ xb8\xf6') unicode 0x4e2a. , , , , . unicode, , , :
>>> s=s.decode('gb2312')
In python3, this distinction between “characters” and “data” is made clearer, since the str object is renamed to “bytes,” and now unicode strings become only strings.
Brian source
share