How to remove accentuated characters from a string with Python
Aug 31, 2011
1 minute read

How to remove accentuated characters from a string with Python

Easy :

output = unicodedata.normalize('NFKD', input).encode('ASCII', 'ignore')

If your input string is not unicode, you’ll have to convert it first :

output = unicodedata.normalize('NFKD', unicode (input, 'utf-8')).encode('ASCII', 'ignore')


comments powered by Disqus