A 'raw' codec for binary "strings" in Python?

Bill Janssen janssen at parc.com
Mon Mar 1 22:54:48 EST 2004


> You could use
>     "\xc0".decode("iso-8859-1").encode('US-ASCII', 'replace')

Yes, this is what I'm doing at the moment.  But it seems a real hack.
The string *isn't* in Latin-1; it's binary, it's data, and there
should be a way of saying that.  Maybe a third kind of string type?

Bill




More information about the Python-list mailing list