I am trying to read an XML.dump file using 'xmltodict' library with python 3 to make a dictionary from this file. The code I used is like:
import xmltodict
with open('file1.xml.dump') as fd:
content = fd.read()
doc = xmltodict.parse(content)
The error that I got is:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
Does anyone know what this error is about of this error and how to fix this problem?
I also added encoding='UTF-8'
in the with open
statement, and I get the same error.