yield c def iterate_lower_byte(): for c in range(0x40, 0x7e + 1): yield c for c in range(0x80, 0xfc + 1): yield c def iterate_zenkaku(): for c1 in iterate_higher_byte(): for c2 in iterate_lower_byte(): yield c1, c2 src_dir = join(dirname(__file__), "..", "src") bin2entry, u2entry = read_entries(join(src_dir, "sjis-0213-2004-std.txt")) write_table(join(src_dir, "shift_jis2yog_hankaku.inc"), iterate_hankaku(), bin2entry) write_table(join(src_dir, "shift_jis2yog_zenkaku.inc"), iterate_zenkaku(), bin2entry) def iterate_unicode1(): for u in range(0xa0, 0x1ff + 1): yield u def iterate_unicode2(): for u in range(0x250, 0x451 + 1): yield u def iterate_unicode3(): for u in range(0x1e3e, 0x9fa2 + 1): yield u for u in range(0xf91d, 0xff9f + 1): yield u
for b in iterate_euc_jp_range(): yield 0x8e, b def iterate_zenkaku(): for b1 in iterate_euc_jp_range(): for b2 in iterate_euc_jp_range(): yield b1, b2 def iterate_3bytes(): for b1 in iterate_euc_jp_range(): for b2 in iterate_euc_jp_range(): yield 0x8f, b1, b2 src_dir = join(dirname(__file__), "..", "src") bin2entry, u2entry = read_entries(join(src_dir, "euc-jis-2004-std.txt")) write_table(join(src_dir, "euc_jp2yog_zenkaku.inc"), iterate_zenkaku(), bin2entry) write_table(join(src_dir, "euc_jp2yog_hankaku.inc"), iterate_hankaku(), bin2entry) write_table(join(src_dir, "euc_jp2yog_3bytes.inc"), iterate_3bytes(), bin2entry) def iterate_unicode1(): for u in range(0xa0, 0x1ff + 1): yield u def iterate_unicode2(): for u in range(0x250, 0x451 + 1): yield u def iterate_unicode3(): for u in range(0x1e3e, 0x9fa2 + 1): yield u for u in range(0xf91d, 0xff9f + 1):