Message180077
An error handler in unicode_escape_decode() eats at least one byte (or more) after illegal escape sequence.
>>> import codecs
>>> codecs.unicode_escape_decode(br'\u!@#', 'replace')
('�', 5)
>>> codecs.unicode_escape_decode(br'\u!@#$', 'replace')
('�@#$', 6)
raw_unicode_escape_decode() works right:
>>> codecs.raw_unicode_escape_decode(br'\u!@#', 'replace')
('�!@#', 5)
>>> codecs.raw_unicode_escape_decode(br'\u!@#$', 'replace')
('�!@#$', 6)
See also issue16975. |
|
Date |
User |
Action |
Args |
2013-01-16 10:46:45 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ezio.melotti |
2013-01-16 10:46:45 | serhiy.storchaka | set | messageid: <1358333205.49.0.474914292402.issue16979@psf.upfronthosting.co.za> |
2013-01-16 10:46:45 | serhiy.storchaka | link | issue16979 messages |
2013-01-16 10:46:44 | serhiy.storchaka | create | |
|