Skip to content

Instantly share code, notes, and snippets.

@Irio
Created December 12, 2017 15:53
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Irio/bc86eed5db55079609da2e71ba3e1ac3 to your computer and use it in GitHub Desktop.
Save Irio/bc86eed5db55079609da2e71ba3e1ac3 to your computer and use it in GitHub Desktop.
normalize_string.py
import unicodedata
def normalize_string(string):
if isinstance(string, str):
nfkd_form = unicodedata.normalize('NFKD', string.lower())
return nfkd_form.encode('ASCII', 'ignore').decode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment