Skip to content

Instantly share code, notes, and snippets.

@hcarvalhoalves
Created March 22, 2013 17:21
Show Gist options
  • 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