◐ Shell
clean mode source ↗

Message 185089 - Python tracker

In 2.7.3 >>>

>>> u'{0:c}'.format(127)
u'\x7f'

>>> u'{0:c}'.format(128)

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    u'{0:c}'.format(128)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)

>>> u'{0:c}'.format(255)

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    u'{0:c}'.format(255)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

>>> u'{0:c}'.format(256)
u'\x00'

>>> u'{0:c}'.format(257)
u'\x01'