updated from Atlas
This commit is contained in:
14
attic/strings-bytes/nfc_demo.py
Normal file
14
attic/strings-bytes/nfc_demo.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import sys
|
||||
from unicodedata import name, normalize
|
||||
|
||||
for i in range(sys.maxunicode):
|
||||
char = chr(i)
|
||||
char_name = name(char, None)
|
||||
if char_name is None:
|
||||
continue
|
||||
nfc = normalize('NFC', char)
|
||||
if nfc == char:
|
||||
continue
|
||||
if len(nfc) > 1:
|
||||
nfc_display = ' '.join(nfc)
|
||||
print('U+%04x' % i, char, nfc_display, char_name, sep='\t')
|
||||
Reference in New Issue
Block a user