what is the unicode?

contro opinion contropinion at gmail.com
Sat Jan 28 02:47:17 EST 2012


as far as i know

>>> u'中国'.encode('utf-8')
'\xe4\xb8\xad\xe5\x9b\xbd'

so,'\xe4\xb8\xad\xe5\x9b\xbd'  is the  utf-8  of  '中国'

>>> u'中国'.encode('gbk')
'\xd6\xd0\xb9\xfa'
so,'\xd6\xd0\xb9\xfa' is the  utf-8  of  '中国'

>>> u'中国'
u'\u4e2d\u56fd'

what is the meaning of u'\u4e2d\u56fd'?
u'\u4e2d\u56fd'  =  \x4e2d\x56fd  ??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120128/6a8b1407/attachment.html>


More information about the Python-list mailing list