Resolve some historically special cases of ambiguous width

[BZ #21750]
* unicode-gen/utf8_gen.py (U+00AD): Set width to 1.
* unicode-gen/utf8_gen.py (U+1160..U+11FF): Set width to 0.
* unicode-gen/utf8_gen.py (U+3248..U+324F): Set width to 2.
* unicode-gen/utf8_gen.py (U+4DC0..U+4DFF): Likewise.
This commit is contained in:
Thorsten Glaser 2017-07-14 14:02:46 +02:00 committed by Mike FABIAN
parent 41b6f0ce85
commit 267ee5d7ab

View File

@ -236,6 +236,18 @@ def process_width(outfile, ulines, elines):
width_dict[int(fields[0], 16)] = unicode_utils.ucs_symbol(
int(fields[0], 16)) + '\t0'
# handle special cases for compatibility
for key in list(range(0x1160, 0x1200)) + list(range(0x3248, 0x3250)) + \
list(range(0x4DC0, 0x4E00)) + list((0x00AD,)):
if key in width_dict:
del width_dict[key]
width_dict[0x1160] = '{:s}...{:s}\t0'.format(
unicode_utils.ucs_symbol(0x1160), unicode_utils.ucs_symbol(0x11FF))
width_dict[0x3248] = '{:s}...{:s}\t2'.format(
unicode_utils.ucs_symbol(0x3248), unicode_utils.ucs_symbol(0x324F))
width_dict[0x4DC0] = '{:s}...{:s}\t2'.format(
unicode_utils.ucs_symbol(0x4DC0), unicode_utils.ucs_symbol(0x4DFF))
for key in sorted(width_dict):
outfile.write(width_dict[key]+'\n')