Last active
October 14, 2021 22:49
-
-
Save bigsnarfdude/979319012dc31a70323e5d64ba057e1c to your computer and use it in GitHub Desktop.
clean ascii python
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
import unicodedata | |
output = unicodedata.normalize('NFD', my_unicode).encode('ascii', 'ignore') | |
myfoo = u'àà' | |
myfoo | |
u'\xe0\xe0' | |
unicodedata.normalize('NFD', myfoo).encode('ascii', 'ignore') | |
'aa' | |
# https://stackoverflow.com/questions/14118352/how-to-convert-unicode-accented-characters-to-pure-ascii-without-accents | |
# https://pypi.org/project/Unidecode/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment