[Python-3000] XML as bytes or unicode?
Stefan Behnel
stefan_ml at behnel.de
Fri Aug 29 11:37:47 CEST 2008
Greg Ewing wrote:
> 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.
Correct. That's exactly what I was indicating.
Stefan
More information about the Python-3000
mailing list