From 6c56e2d6e127471d198e78c02e5dcb9c9dd02a0c Mon Sep 17 00:00:00 2001 From: Gordon Messmer Date: Tue, 23 Jul 2019 19:47:32 -0700 Subject: [PATCH 1/2] Allow fallback to UTF-8 encoding on systems with no locales installed. --- Lib/locale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/locale.py b/Lib/locale.py index 4127d917465936..e94f0d1acbaa7d 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -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', From 244fcd13c5c2cf2105f37464052a70e73f197ca5 Mon Sep 17 00:00:00 2001 From: Gordon Messmer Date: Tue, 25 Apr 2023 22:06:54 -0700 Subject: [PATCH 2/2] Add news: Allow fallback to UTF-8 encoding on systems with no locales installed. --- .../next/Library/2023-04-25-22-06-00.gh-issue-74940.TOacQ9.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2023-04-25-22-06-00.gh-issue-74940.TOacQ9.rst diff --git a/Misc/NEWS.d/next/Library/2023-04-25-22-06-00.gh-issue-74940.TOacQ9.rst b/Misc/NEWS.d/next/Library/2023-04-25-22-06-00.gh-issue-74940.TOacQ9.rst new file mode 100644 index 00000000000000..c37d795f3eb33d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-04-25-22-06-00.gh-issue-74940.TOacQ9.rst @@ -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.