Re: unicode problems in elementtree
Jarek Zgoda <[email protected]>
| Newsgroups | gmane.comp.python.xml |
|---|---|
| Message-ID | <[email protected]> |
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 http://jpa.berlios.de/ _______________________________________________ XML-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/xml-sig