On Fri, Nov 16, 2012 at 5:33 PM, Nobody <nob...@nowhere.com> wrote: > If you need to support either, you can parse it as ISO-8859-1 then > explicitly convert C1 codes to their Windows-1252 equivalents as a > post-processing step, e.g. using the .translate() method.
Or just create a custom codec by taking the one in Lib/encodings/cp1252.py and modifying it slightly. >>> import codecs >>> import cp1252a >>> codecs.register(lambda n: cp1252a.getregentry() if n == "cp1252a" else None) >>> b'\x81\x8d\x8f\x90\x9d'.decode('cp1252a') '♕♖♗♘♙' -- http://mail.python.org/mailman/listinfo/python-list