Python 3.1.1 bytes decode with replace bug

Joe JoeSalmeri at hotmail.com
Mon Oct 26 15:57:55 EDT 2009


Thanks Mark, that is a great suggestion!

> You can also replace the Unicode replacement character U+FFFD with a valid
> cp437 character before displaying it:
>
> >>> b'\x80abc'.decode('utf8','replace').replace('\ufffd','?')
>
> '?abc'
>



More information about the Python-list mailing list