Unicode и `декодировать ()`в Python

>>> a = "我"  # chinese  
>>> b = unicode(a,"gb2312")  
>>> a.__class__   
<type 'str'>   
>>> b.__class__   
<type 'unicode'>  # b is unicode
>>> a
'\xce\xd2'
>>> b
u'\u6211' 

>>> c = u"我"
>>> c.__class__
<type 'unicode'>  # c is unicode
>>> c
u'\xce\xd2'

bи cвсе юникодные, но >>> bвыводит u'\u6211', а >>> cвыводит u'\xce\xd2', почему?

8
задан jogojapan 25 April 2012 в 02:51
поделиться