[Python-Dev] bytes.from_hex() (original) (raw)

Bob Ippolito bob at redivi.com
Tue Feb 21 05:27:22 CET 2006


On Feb 20, 2006, at 7:25 PM, Stephen J. Turnbull wrote:

"Martin" == Martin v Löwis <martin at v.loewis.de> writes: Martin> Please do take a look. It is the only way: If you were to Martin> embed base64 bytes into character data content of an XML Martin> element, the resulting XML file might not be well-formed Martin> anymore (if the encoding of the XML file is not an ASCII Martin> superencoding). Excuse me, I've been doing category theory recently. By "embedding" I mean a map from an intermediate object which is a stream of bytes to the corresponding stream of characters. In the case of UTF-16-coded characters, this would necessarily imply a representation change, as you say. What I advocate for Python is to require that the standard base64 codec be defined only on bytes, and always produce bytes. Any representation change should be done explicitly. This is surely conformant with RFC 2045's definition and with RFC 3548.

+1

-bob



More information about the Python-Dev mailing list