From 267ee5d7ab57591a6b1bc2d2a010c88188427063 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Fri, 14 Jul 2017 14:02:46 +0200 Subject: 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. --- localedata/unicode-gen/utf8_gen.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'localedata/unicode-gen') diff --git a/localedata/unicode-gen/utf8_gen.py b/localedata/unicode-gen/utf8_gen.py index 332751b35b..1563aa11d2 100755 --- a/localedata/unicode-gen/utf8_gen.py +++ b/localedata/unicode-gen/utf8_gen.py @@ -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') -- cgit 1.4.1