问题描述:

I am trying to read a string with xml content using lxml library.

I encode the string to utf-16 converting it to byte, that is what the XML expects:

root = etree.XML(xml.encode('utf-16'))

This launches next error:

lxml.etree.XMLSyntaxError: Char 0x0 out of allowed range, line 2, column 3

Here is the xml encoded. The character selected is the one referenced in the error message:

And I can't see if the problem is in some character or I am not using correctly the library.

相关阅读:
Top