Python unicodedata

ポータル Python

since 2011-04-20

normalize

全角文字を半角文字に正規化できる:

>>> import unicodedata
>>> unicodedata.normalize('NFKC', u'100')
u'100'
>>> unicodedata.normalize('NFKC', u'.')
u'.'
>>> unicodedata.normalize('NFKC', u'・')
u'\u30fb'
>>> unicodedata.normalize('NFKC', u'、')
u'\u3001'
>>> unicodedata.normalize('NFKC', u'A')
u'A'
>>> unicodedata.normalize('NFKC', u'~')
u'~'

python_unicodedata.txt · 最終更新: 2011/04/20 12:17 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0