python解析xml文件注意
2016-01-11 17:18
573 查看
python2.7 版本 无法解析xml gb2312的编码。
所有一般的做法为:
来自 v2ex:
http://www.v2ex.com/t/136511
所有一般的做法为:
dstr = dstr.decode('gb2312').encode('utf-8') dstr = dstr.replace('gb2312','utf-8')
来自 v2ex:
http://www.v2ex.com/t/136511
相关文章推荐
- Unicode Tips
- python数字图像处理(2):图像的读取、显示与保存
- 自学Python一 迷茫中的开端!
- [151225] Python3 实现最大堆、堆排序,解决TopK问题
- Spark环境下的Kmeans-Python实现
- python豆瓣电影爬虫
- Python篇----命令行调用、输出log日志并打包的脚本
- Python进阶06-10
- [160111] Python学习记录
- Python使用wxPython报错解决方法
- Python转码问题
- [转]python pickle包,cPickle包 存储
- [转]python yield
- Python函数对象
- [转]Python核心模块——urllib模块
- 17个新手常见Python运行时错误
- 4.7.2. Keyword Arguments(关键字参数)
- python split()黑魔法
- python小点心--globals函数
- python爬山算法