[Python-3000] XML as bytes or unicode?

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 28 02:47:26 CEST 2008


Stefan Behnel wrote:

> In the absence of information provided by an external transport protocol (e.g.
> HTTP or MIME), it is a fatal error for an entity including an encoding
> declaration to be presented to the XML processor in an encoding other than
> that named in the declaration [...]

But if the XML has already been decoded and turned into
a Python unicode string, there *is* external information
about the encoding -- we know it's encoded however Python
represents unicode internally. So this clause doesn't
apply.

-- 
Greg


More information about the Python-3000 mailing list