推荐学习书目
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
figol
V2EX  ›  Python

想用 python 去除 xml 文件中的法语字母 à â ä è é î ô等;大牛们,有没有好方法推荐?

  •  
  •   figol ·
    figol · Oct 22, 2014 · 5699 views
    This topic created in 4220 days ago, the information mentioned may be changed or developed.
    7 replies    2014-10-22 20:37:26 +08:00
    icedx
        1
    icedx  
       Oct 22, 2014 via Android
    你搜下 这个问题很有名…
    具体链接忘记了...
    plprapper
        2
    plprapper  
       Oct 22, 2014
    asc 有范围吗
    poke707
        3
    poke707  
       Oct 22, 2014 via Android
    这些字符估计其unicode是连着的,简单的正则即可替换掉
    Actrace
        4
    Actrace  
       Oct 22, 2014
    法语字母不多吧 ..?
    匹配替换.
    wangfengmadking
        5
    wangfengmadking  
       Oct 22, 2014
    我一般就用.encode('ascii', "ignore")来忽略了
    R4rvZ6agNVWr56V0
        6
    R4rvZ6agNVWr56V0  
       Oct 22, 2014
    查下unicode字符集表 http://www.tamasoft.co.jp/en/general-info/unicode.html
    找到区间:00C0~0100 (我不懂法语,看着像而已)
    写正则匹配^[\u00C0-\u0100]+$

    思路基本这样子。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3706 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 75ms · UTC 00:40 · PVG 08:40 · LAX 17:40 · JFK 20:40
    ♥ Do have faith in what you're doing.