Message233010
[Edit Error: 'utf8' codec can't decode byte 0xe2 in position 212: invalid continuation byte]
Re-reading the suggested description, it struck me that for encoding, this is redundant with the “backslashreplace” error handler:
>>> test = "".join(map(chr, range(sys.maxunicode + 1)))
>>> test.encode("raw-unicode-escape") == test.encode("latin-1", "backslashreplace")
True
However, decoding also seems similar to “unicode_escape”, except that only \uXXXX and \UXXXXXXXX seem to be supported.
Maybe there should be a warning that backslashes are not escaped:
>>> "\\u005C".encode("raw-unicode-escape").decode("raw-unicode-escape")
'\\' |
|
Date |
User |
Action |
Args |
2014-12-22 06:01:56 | martin.panter | set | recipients:
+ martin.panter, lemburg, terry.reedy, vstinner, ezio.melotti, zuo, docs@python |
2014-12-22 06:01:56 | martin.panter | set | messageid: <1419228116.31.0.0723368338311.issue19539@psf.upfronthosting.co.za> |
2014-12-22 06:01:56 | martin.panter | link | issue19539 messages |
2014-12-22 06:01:56 | martin.panter | create | |
|