mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-74940: Allow fallback to UTF-8 encoding on systems with no locales installed (GH-14925)
This change removes the alias of the 'C' locale to 'en_US'. Because of this alias, it is currently impossible for an application to use setlocale() to specify a UTF-8 locale on a system that has no locales installed, but which supports the C.UTF-8 locale/encoding.
This commit is contained in:
parent
31acfd78a0
commit
2763994be3
2 changed files with 3 additions and 1 deletions
|
|
@ -962,7 +962,7 @@ def getpreferredencoding(do_setlocale=True):
|
|||
'c.ascii': 'C',
|
||||
'c.en': 'C',
|
||||
'c.iso88591': 'en_US.ISO8859-1',
|
||||
'c.utf8': 'en_US.UTF-8',
|
||||
'c.utf8': 'C.UTF-8',
|
||||
'c_c': 'C',
|
||||
'c_c.c': 'C',
|
||||
'ca': 'ca_ES.ISO8859-1',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
The C.UTF-8 locale is no longer converted to en_US.UTF-8, enabling the use
|
||||
of UTF-8 encoding on systems which have no locales installed.
|
||||
Loading…
Add table
Add a link
Reference in a new issue