Created
March 22, 2013 17:21
-
-
Save hcarvalhoalves/5223105 to your computer and use it in GitHub Desktop.
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
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