Why are some unicode error handlers "encode only"?
steve+comp.lang.python at pearwood.info
Sun Mar 11 15:37:54 CET 2012
At least two standard error handlers are documented as working for
Why is this? I don't see why they shouldn't work for decoding as well.
Consider this example using Python 3.2:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'cp932' codec can't decode bytes in position 9-10:
illegal multibyte sequence
The two bytes b'\xe9!' is an illegal multibyte sequence for CP-932 (also
known as MS-KANJI or SHIFT-JIS). Is there some reason why this shouldn't
or can't be supported?
# This doesn't actually work.
and similarly for xmlcharrefreplace.
More information about the Python-list