summaryrefslogtreecommitdiffstats
path: root/util/locale_database/ldml.py
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-07-03 14:13:15 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-07-17 12:19:01 +0200
commitd8538163075a2058f110bc77e7d481ef1ab7612c (patch)
tree81baa561bc27826b587ed220342a4a8602298400 /util/locale_database/ldml.py
parent51e3cd89a81abdbf2fb6c60054d418084e4474c4 (diff)
Fix handling of Suzhou numbering system
This only arises when the system locale tells us to use its zero as our zero digit, since no CLDR locale uses it by default. Adapt an MS-specific QLocale::system() test to use Suzhou numbering, so as to test this. While updating the locale-restoration code to also restore the digits being set in that test, add restore code for the long time format, where previously only the short time format was restored. Add a comment to make it less likely one of those shall be missed in future. Fixes: QTBUG-85409 Change-Id: I343324bb563ee0e455dfe77d4825bf8c3082ca30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'util/locale_database/ldml.py')
-rw-r--r--util/locale_database/ldml.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/locale_database/ldml.py b/util/locale_database/ldml.py
index 0f1cefc30c..0f08884d4b 100644
--- a/util/locale_database/ldml.py
+++ b/util/locale_database/ldml.py
@@ -299,8 +299,10 @@ class LocaleScanner (object):
digits = lookup(system)['digits']
assert len(digits) == 10
zero = digits[0]
- # Qt's number-formatting code assumes digits are consecutive:
- assert all(ord(c) == i for i, c in enumerate(digits, ord(zero)))
+ # Qt's number-formatting code assumes digits are consecutive
+ # (except Suzhou, CLDR's hanidec - see QTBUG-85409):
+ assert all(ord(c) == i + (0x3020 if ord(zero) == 0x3007 else ord(zero))
+ for i, c in enumerate(digits[1:], 1))
yield 'zero', zero
plus = self.find(stem + 'plusSign')