Created
March 24, 2016 09:04
-
-
Save vpascual/64334771dc0aba8be0f4 to your computer and use it in GitHub Desktop.
This little function gets a text in UTF-8 and returns the same string without accents. It is useful for comparing texts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_accents(text): | |
return unicodedata.normalize('NFKD', unicode(text, 'utf-8')).encode('ASCII', 'ignore') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment