Pythonでunicode正規化

unicodedataを使えばよい。

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import unicodedata
>>> print unicodedata.normalize(u'NFKC', u'テスト①%@')
テスト1%@

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です