PHP前端开发

关于字符编码问题的详细介绍

百变鹏仔 2个月前 (02-07) #Python
文章标签 详细介绍

为了简化问题,就把xml的内容简化为如下的形式:它的encoding为gbk,其中的节点有一个为中文字符 使用lxml提取节点的值时出现了如下的异常lxml.etree.XMLSyntaxError: Extra content at the end of the document此时对应的Python脚本为:tst = u'