[Python-Dev] bytes.from_hex()

"Martin v. Löwis" martin at v.loewis.de
Mon Feb 20 22:44:00 CET 2006


Stephen J. Turnbull wrote:
>     Martin> For an example where base64 is *not* necessarily
>     Martin> ASCII-encoded, see the "binary" data type in XML
>     Martin> Schema. There, base64 is embedded into an XML document,
>     Martin> and uses the encoding of the entire XML document. As a
>     Martin> result, you may get base64 data in utf16le.
> 
> I'll have to take a look.  It depends on whether base64 is specified
> as an octet-stream to Unicode stream transformation or as an embedding
> of an intermediate representation into Unicode.  Granted, defining the
> base64 alphabet as a subset of Unicode seems like the logical way to
> do it in the context of XML.

Please do take a look. It is the only way: If you were to embed base64
*bytes* into character data content of an XML element, the resulting
XML file might not be well-formed anymore (if the encoding of the XML
file is not an ASCII superencoding).

Regards,
Martin


More information about the Python-Dev mailing list