ElementTree and utf-16 encoding

Fredrik Lundh fredrik at pythonware.com
Tue Dec 19 04:49:32 EST 2006


Sébastien Boisgérault wrote:

> ET being ElementTree in the following code, could anyone explain
> why it fails ?

I'm afraid the standard serializer in 1.2 only supports ASCII-compatible 
encodings.  this will be fixed in 1.3.

as a workaround, you can do:

     tostring(elem).decode("utf-8").encode("utf-16")

</F>




More information about the Python-list mailing list