V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ivanchou
V2EX  ›  Python

python 在解析 xml 时遇到的外文字符的问题

  •  
  •   ivanchou · 2015-05-05 23:39:19 +08:00 · 3686 次点击
    这是一个创建于 3295 天前的主题,其中的信息可能已经有所发展或是发生改变。
    xml.etree.ElementTree.ParseError: undefined entity ö: line 47, column 18

    解析 xml 时遇到这个错误,搜索 ö 找到 http://www.thesauruslex.com/typo/eng/enghtml.htm 了这个,得知是外文的字符。

    xml 的 encoding="ISO-8859-1",而且在 sublime 中使用 ISO-8859-1 打开外文字符也并没有正确显示出来。

    google 了一圈没有发现解决办法,求解决方法。
    2 条回复    2015-05-08 14:33:27 +08:00
    ivanchou
        2
    ivanchou  
    OP
       2015-05-08 14:33:27 +08:00
    @zzxworld 感谢 今天才发现这个问题的回答是有用的 虽然还没看明白是怎么实现的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3205 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.