summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-05-17 13:22:30 +0200
committerRonald Oussoren <ronaldoussoren@mac.com>2011-05-17 13:22:30 +0200
commit5bf77fca1e8c862bddf43abed69a66350b2f9448 (patch)
treee3b40ed82db2bc240175ab32a11540953dfd84b9
parent7dca4ee0e691dcf69bd6f4a5761366d7d11abbb3 (diff)
downloadcpython-5bf77fca1e8c862bddf43abed69a66350b2f9448.tar.gz
(backport)Fix #10154 and #10090: locale normalizes the UTF-8 encoding to "UTF-8" instead of "UTF8"
On MacOSX and OpenBSD (and possibly other BSDs) "en_US.UTF-8" is a valid locale while "en_US.UTF8" is not. As the former works on Linux as well it is better to normalize to that value.
-rw-r--r--Lib/locale.py2
-rw-r--r--Misc/NEWS3
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 921f4f6bef..bb4aa37b29 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -621,7 +621,7 @@ locale_encoding_alias = {
'tactis': 'TACTIS',
'euc_jp': 'eucJP',
'euc_kr': 'eucKR',
- 'utf_8': 'UTF8',
+ 'utf_8': 'UTF-8',
'koi8_r': 'KOI8-R',
'koi8_u': 'KOI8-U',
# XXX This list is still incomplete. If you know more
diff --git a/Misc/NEWS b/Misc/NEWS
index 23f77e5560..3262205db4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -80,6 +80,9 @@ Core and Builtins
Library
-------
+- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
+ of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
+
- Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET is
set in shell.