123456789101112131415161718192021222324252627282930313233343536373839 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- import os
- import sys
-
- def readtable(filename):
- with open(filename) as f:
- for line in f:
- if line == '\n' or line.startswith('#'):
- continue
- yield line.split()[0:2]
-
- table = {}
- for code, mapped in readtable(sys.argv[1]):
- table[int(code, 0)] = mapped.lower()
-
- for code in range(0x80, 0x100):
- if (code % 8 == 0):
- print('\t', end='')
- print('%s, ' % table.get(code, '0xfffd'), end='')
- if (code % 8 == 7):
- print('// %02x\n' % (code - 7), end='')
|