Python 3 chokes on CP-1252/ANSI reading

Position 0x81 is unassigned in Windows-1252 (aka cp1252). It is assigned to U+0081 HIGH OCTET PRESET (HOP) control character in Latin-1 (aka ISO 8859-1). I can reproduce your error in Python 3.1 like this: >>> b’\x81′.decode(‘cp1252’) Traceback (most recent call last): … UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x81 in position 0: character maps to … Read more