]> granicus.if.org Git - python/commitdiff
(backport)Fix #10154 and #10090: locale normalizes the UTF-8 encoding to "UTF-8"...
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 17 May 2011 11:22:30 +0000 (13:22 +0200)
committerRonald Oussoren <ronaldoussoren@mac.com>
Tue, 17 May 2011 11:22:30 +0000 (13:22 +0200)
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.

Lib/locale.py
Misc/NEWS

index 921f4f6bef103ab55e5ad0cc09c73b61326d99e9..bb4aa37b2906bdc9e27e67702a36eac476f3a9de 100644 (file)
@@ -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
index 23f77e5560b48c8bc1c38d7d14bb63a52f549681..3262205db4c54c92f6321bccfa817ae08ed0bbf3 100644 (file)
--- 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.