#---------- mk_unicode_chart.py----------# # Create an HTML chart of Unicode characters by codepoint import sys head = 'Unicode Code Points\n' +\ '\n' +\ '\n

Unicode Code Points

' foot = '' fp = sys.stdout fp.write(head) num_blocks = 32 # Up to 256 in theory, but IE5.5 is flaky for block in range(0,256*num_blocks,256): fp.write('\n\n

Range %5d-%5d

' % (block,block+256)) start = unichr(block).encode('utf-16') fp.write('\n
     ')
    for col in range(16): fp.write(str(col).ljust(3))
    fp.write('
') for offset in range(0,256,16): fp.write('\n
')
        fp.write('+'+str(offset).rjust(3)+' ')
        line = '  '.join([unichr(n+block+offset) for n in range(16)])
        fp.write(line.encode('UTF-8'))
        fp.write('
') fp.write(foot) fp.close()