Skip to content

Instantly share code, notes, and snippets.

@vpascual
Created March 24, 2016 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpascual/64334771dc0aba8be0f4 to your computer and use it in GitHub Desktop.
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
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