Skip to content

Instantly share code, notes, and snippets.

@jtauber
Created December 5, 2015 02:45
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 jtauber/ce4bb07f539461de84a1 to your computer and use it in GitHub Desktop.
Save jtauber/ce4bb07f539461de84a1 to your computer and use it in GitHub Desktop.
NFKC normalisation in python 2 and 3
#!/usr/bin/env python
import sys
import unicodedata
with open(sys.argv[1]) as f:
for line in f:
sys.stdout.write(unicodedata.normalize("NFKC", line.decode("utf-8")).encode("utf-8"))
#!/usr/bin/env python3
import sys
import unicodedata
with open(sys.argv[1]) as f:
for line in f:
sys.stdout.write(unicodedata.normalize("NFKC", line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment