Tuesday, March 29, 2005

Python unicode browser

In the process of playing around with punycode today, I ended up writing this:

import unicodedata, pydoc
pydoc.pager('\n'.join(['%s: %s - %x' % (unichr(i).encode('utf-8'),
unicodedata.name(unichr(i), '<NO NAME>'),
for i in range(0xA1, 0x10000)]))

Make sure your terminal supports UTF-8 or you will not experience the full enjoyment.

No comments:

Post a Comment