Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c383ad8

Browse files
Issue #20076: Added non derived UTF-8 aliases to locale aliases table.
The makelocalealias.py script no longer ignores UTF-8 mapping.
2 parents 20df057 + 1de0ba2 commit c383ad8

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lib/locale.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ def getpreferredencoding(do_setlocale = True):
861861
'az_az.iso88599e': 'az_AZ.ISO8859-9E',
862862
'be': 'be_BY.CP1251',
863863
'be@latin': 'be_BY.UTF-8@latin',
864+
'be_bg.utf8': 'bg_BG.UTF-8',
864865
'be_by': 'be_BY.CP1251',
865866
'be_by@latin': 'be_BY.UTF-8@latin',
866867
'bem_zm': 'bem_ZM.UTF-8',
@@ -887,6 +888,7 @@ def getpreferredencoding(do_setlocale = True):
887888
'c.ascii': 'C',
888889
'c.en': 'C',
889890
'c.iso88591': 'en_US.ISO8859-1',
891+
'c.utf8': 'en_US.UTF-8',
890892
'c_c': 'C',
891893
'c_c.c': 'C',
892894
'ca': 'ca_ES.ISO8859-1',
@@ -940,6 +942,7 @@ def getpreferredencoding(do_setlocale = True):
940942
'en_bw': 'en_BW.ISO8859-1',
941943
'en_ca': 'en_CA.ISO8859-1',
942944
'en_dk': 'en_DK.ISO8859-1',
945+
'en_dl.utf8': 'en_DL.UTF-8',
943946
'en_gb': 'en_GB.ISO8859-1',
944947
'en_hk': 'en_HK.ISO8859-1',
945948
'en_ie': 'en_IE.ISO8859-1',
@@ -954,6 +957,7 @@ def getpreferredencoding(do_setlocale = True):
954957
'en_za': 'en_ZA.ISO8859-1',
955958
'en_zm': 'en_ZM.UTF-8',
956959
'en_zw': 'en_ZW.ISO8859-1',
960+
'en_zw.utf8': 'en_ZS.UTF-8',
957961
'eng_gb': 'en_GB.ISO8859-1',
958962
'english': 'en_EN.ISO8859-1',
959963
'english_uk': 'en_GB.ISO8859-1',
@@ -1106,6 +1110,7 @@ def getpreferredencoding(do_setlocale = True):
11061110
'korean.euc': 'ko_KR.eucKR',
11071111
'ks': 'ks_IN.UTF-8',
11081112
'ks_in': 'ks_IN.UTF-8',
1113+
'[email protected]': 'ks_IN.UTF-8@devanagari',
11091114
'ku_tr': 'ku_TR.ISO8859-9',
11101115
'kw': 'kw_GB.ISO8859-1',
11111116
'kw_gb': 'kw_GB.ISO8859-1',
@@ -1218,6 +1223,7 @@ def getpreferredencoding(do_setlocale = True):
12181223
'sc_it': 'sc_IT.UTF-8',
12191224
'sd': 'sd_IN.UTF-8',
12201225
'sd_in': 'sd_IN.UTF-8',
1226+
'[email protected]': 'sd_IN.UTF-8@devanagari',
12211227
'se_no': 'se_NO.UTF-8',
12221228
'serbocroatian': 'sr_RS.UTF-8@latin',
12231229
'sh': 'sr_RS.UTF-8@latin',
@@ -1258,6 +1264,7 @@ def getpreferredencoding(do_setlocale = True):
12581264
'sr_cs@latn': 'sr_CS.UTF-8@latin',
12591265
'sr_me': 'sr_ME.UTF-8',
12601266
'sr_rs': 'sr_RS.UTF-8',
1267+
'sr_rs.utf8@latn': 'sr_RS.UTF-8@latin',
12611268
'sr_rs@latn': 'sr_RS.UTF-8@latin',
12621269
'sr_sp': 'sr_CS.ISO8859-2',
12631270
'sr_yu': 'sr_RS.UTF-8@latin',
@@ -1266,6 +1273,8 @@ def getpreferredencoding(do_setlocale = True):
12661273
'sr_yu.iso88595': 'sr_CS.ISO8859-5',
12671274
'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5',
12681275
'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251',
1276+
'sr_yu.utf8': 'sr_RS.UTF-8',
1277+
'sr_yu.utf8@cyrillic': 'sr_RS.UTF-8',
12691278
'sr_yu@cyrillic': 'sr_RS.UTF-8',
12701279
'ss': 'ss_ZA.ISO8859-1',
12711280
'ss_za': 'ss_ZA.ISO8859-1',

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Core and Builtins
156156
Library
157157
-------
158158

159+
- Issue #20076: Added non derived UTF-8 aliases to locale aliases table.
160+
159161
- Issue #20079: Added locales supported in glibc 2.18 to locale alias table.
160162

161163
- Issue #20218: Added convenience methods read_text/write_text and read_bytes/
@@ -1188,6 +1190,8 @@ Tests
11881190
Tools/Demos
11891191
-----------
11901192

1193+
- Issue #20076: The makelocalealias.py script no longer ignores UTF-8 mapping.
1194+
11911195
- Issue #20079: The makelocalealias.py script now can parse the SUPPORTED file
11921196
from glibc sources and supports command line options for source paths.
11931197

Tools/i18n/makelocalealias.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ def parse(filename):
4545
encoding = encoding.replace('-', '')
4646
encoding = encoding.replace('_', '')
4747
locale = lang + '.' + encoding
48-
if encoding.lower() == 'utf8':
49-
# Ignore UTF-8 mappings - this encoding should be
50-
# available for all locales
51-
continue
5248
data[locale] = alias
5349
return data
5450

0 commit comments

Comments
 (0)