You see Problem 7267 - format method: c presentation type broken in 2.7 .
, format(int, 'c') int.__format__('c'), str ( Python 2.x), (0, 256). , , 256, 0. -
>>> format(256,'c')
'\x00'
, , Python 3, unicode, , , Python 3.x.
, , unichr() -
>>> unichr(0x6211)
u'\u6211'
>>> print(unichr(0x6211))
我
, , : 6211 - , , , 0x1843. , , 0x6211, , 我, format(0x6211,'c') Python 3.x.
source
share