我有一个这样的xml文件
<?xml version="1.0" encoding="UTF-8"?>
<tw>
<tweet>
<yazi>atılacak tweet 1</yazi>
<resim>resim.png</resim>
</tweet>
<tweet>
<yazi>atılacak tweet 2</yazi>
<resim>yok</resim>
</tweet>
</tw>
我试着用它来读
^{pr2}$但我发现这个错误
xml.etree.ElementTree.ParseError: encoding specified in XML declaration is incorrect: line 1, column 31
为什么?如何解决这个问题,我搜索了很多,xml文件看起来没问题。我不明白为什么我看不懂文件。在
文件中可能有一个无效的utf-8字符,例如xml文件是iso-8859-1编码的。。。或者你可以用utf-8代替utf-8
相关问题 更多 >
编程相关推荐