1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- import os
- import sys
- import ucd
-
- ucd_rootdir = sys.argv[1]
-
- unicode_chars = {}
- for data in ucd.parse_ucd_data(ucd_rootdir, 'UnicodeData'):
- for codepoint in data['CodePoint']:
- unicode_chars[codepoint] = data
-
- null = ucd.CodePoint('0000')
- if __name__ == '__main__':
- for codepoint in ucd.CodeRange('000000..10FFFF'):
- try:
- data = unicode_chars[codepoint]
- title = data['TitleCase']
- upper = data['UpperCase']
- lower = data['LowerCase']
- if title == null: title = codepoint
- if upper == null: upper = codepoint
- if lower == null: lower = codepoint
- print '%s %s %s %s %s' % (codepoint, data['GeneralCategory'], upper, lower, title)
- except KeyError:
- print '%s Cn %s %s %s' % (codepoint, codepoint, codepoint, codepoint)
|