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' >