1

I am trying to parse a XML file into python using the ElementTree class, which also means that I want to make it into a ElementTree instance. I tried using the "parse" method of the ElementTree class, but it gives the following error:

xml.etree.ElementTree.ParseError: encoding specified in XML declaration is incorrect: line 1, column 30

When investigating further, it is because it doesn't like the fact that the inputted XML file is encoded in UTF-16 rather than UTF-8.

Any way to parse this XML and make it into a ElementTree instance?

martineau
  • 119,623
  • 25
  • 170
  • 301

0 Answers0