[XML-SIG] "encoding" argument to xml.dom.minidom.toxml()?

Bill Janssen janssen at parc.com
Tue Jun 10 22:59:06 CEST 2008


> >     writer = codecs.lookup(encoding)[3](writer, "xmlcharrefreplace")
> Could be done, yes. ElementTree and lxml do it that way. It's not required,
> though. If you say you want to serialise plain ASCII data, nothing keeps an
> XML serialiser from shouting at you when it finds non-ASCII data. Same for
> latin1 data or kyrillic data, or ...

I'm not sure what you're saying.  The "encoding" parameter is about
the character set encoding of the XML output file; it has little or
nothing to do with the input data, which in my case is all unicode
strings.  Clearly, with XML, one can use ASCII, for instance, as a
character set encoding.  Why not make this parameter work?


More information about the XML-SIG mailing list