[XML-SIG] unicode problems in elementtree

Jarek Zgoda jzgoda at o2.pl
Sat May 27 12:26:32 CEST 2006

Bryan Lawrence napisał(a):

> I suspect the problem is that I'm not actually passing an xml document (with a 
> character encoding definition) to ET ... I'm just passing some stuff which is 
> an xml fragment (from a web service interface to a database).
> Does elementtree and/or expat need to know the encoding to get this right? 
> (which may be a problem coz this could be from anyone's document in any 
> encoding ...)

As per XML spec, if no encoding is declared, UTF-8 is assumed (AFAIK
expat follows this). Check if your data is valid UTF-8. Expat accepts
only UTF-8, UTF-16, iso-8859-1 and ascii data, but without encoding
declaration treats everything as UTF-8.

Jarek Zgoda

More information about the XML-SIG mailing list