I am currently using lxml to write a file. I build the node and then I write it to a file using etree.tostring(node, pretty_print=True). However, it seems to be using htmlencoding --
<Synopsis>
Abila schließlich die ersten sechs Aufgaben zu meistern. Wird der Junge auch
</Synopsis>
In order to decipher it and get it into the format I want it in, I am currently doing:
>>> print HTMLParser.HTMLParser().unescape('Abila schließlich die ersten sechs Aufgaben zu meistern. Wird der Junge auch')
Abila schließlich die ersten sechs Aufgaben zu meistern. Wird der Junge auch
How would I have this write in unicode, or is this not possible with lxml ?
Yes you can pass an encoding to
etree.tostringmethod using theencodingparameter:From the
etree.tostringdocs: