File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -883,6 +883,10 @@ def getpreferredencoding(do_setlocale=True):
883
883
# updated 'sr@latn' -> 'sr_CS.UTF-8@latin' to 'sr_RS.UTF-8@latin'
884
884
# removed 'univ'
885
885
# removed 'universal'
886
+ #
887
+ # SS 2025-06-10:
888
+ # Remove 'c.utf8' -> 'en_US.UTF-8' because 'en_US.UTF-8' does not exist
889
+ # on all platforms.
886
890
887
891
locale_alias = {
888
892
'a3' : 'az_AZ.KOI8-C' ,
@@ -962,7 +966,6 @@ def getpreferredencoding(do_setlocale=True):
962
966
'c.ascii' : 'C' ,
963
967
'c.en' : 'C' ,
964
968
'c.iso88591' : 'en_US.ISO8859-1' ,
965
- 'c.utf8' : 'en_US.UTF-8' ,
966
969
'c_c' : 'C' ,
967
970
'c_c.c' : 'C' ,
968
971
'ca' : 'ca_ES.ISO8859-1' ,
Original file line number Diff line number Diff line change @@ -387,6 +387,10 @@ def test_c(self):
387
387
self .check ('c' , 'C' )
388
388
self .check ('posix' , 'C' )
389
389
390
+ def test_c_utf8 (self ):
391
+ self .check ('c.utf8' , 'C.UTF-8' )
392
+ self .check ('C.UTF-8' , 'C.UTF-8' )
393
+
390
394
def test_english (self ):
391
395
self .check ('en' , 'en_US.ISO8859-1' )
392
396
self .check ('EN' , 'en_US.ISO8859-1' )
Original file line number Diff line number Diff line change
1
+ Do not normalize :mod: `locale ` name 'C.UTF-8' to 'en_US.UTF-8'.
Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ def check(data):
140
140
data = locale .locale_alias .copy ()
141
141
data .update (parse_glibc_supported (args .glibc_supported ))
142
142
data .update (parse (args .locale_alias ))
143
+ # Hardcode 'c.utf8' -> 'C.UTF-8' because 'en_US.UTF-8' does not exist
144
+ # on all platforms.
145
+ data ['c.utf8' ] = 'C.UTF-8'
143
146
while True :
144
147
# Repeat optimization while the size is decreased.
145
148
n = len (data )
You can’t perform that action at this time.
0 commit comments