Skip to content

Instantly share code, notes, and snippets.

@Peilonrayz

Peilonrayz/nfkc.py Secret

Last active Jul 21, 2019
Embed
What would you like to do?
import unicodedata
def collisions(char):
char = unicodedata.normalize('NFKC', char)
for i in range(0x110000):
if unicodedata.normalize('NFKC', chr(i)) == char:
yield chr(i)
if __name__ == '__main__':
for char in collisions(input('Enter char: ')):
try:
print(char)
except UnicodeEncodeError:
print('-', ord(char))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.