Skip to content

Instantly share code, notes, and snippets.

@74hc595
Created July 25, 2016 17:54
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 74hc595/6134b1f886a4e0ba342d91e71c9161d9 to your computer and use it in GitHub Desktop.
Save 74hc595/6134b1f886a4e0ba342d91e71c9161d9 to your computer and use it in GitHub Desktop.
Generates a list of Unicode code points sorted by name length
#!/usr/bin/env python
import unicodedata
chars = []
for c in xrange(0,0x10FFFF):
try:
name = unicodedata.name(unichr(c))
chars.append((c,name))
except:
pass
chars.sort(key=lambda a: len(a[1]))
print '\n'.join('U+{:06X} {}'.format(c, name) for c, name in chars)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment