Skip to content

Instantly share code, notes, and snippets.

@hcarvalhoalves
Created March 22, 2013 17:21
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 hcarvalhoalves/5223105 to your computer and use it in GitHub Desktop.
Save hcarvalhoalves/5223105 to your computer and use it in GitHub Desktop.
from unicodedata import normalize, category
def unaccent(s):
return unicode(
filter(
lambda c: category(c) != 'Mn',
normalize('NFKD', s.decode('utf-8'))
)
).encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment