<分区>
Possible Duplicate:
What is the best way to remove accents in a python unicode string?
Python and character normalization
我想删除重音符号,将所有字符变为小写,并删除任何数字和特殊字符。
示例:
Frédér8ic@ --> 弗雷德里克
提案:
def remove_accents(data):
return ''.join(x for x in unicodedata.normalize('NFKD', data) if \
unicodedata.category(x)[0] == 'L').lower()
有没有更好的方法来做到这一点?