-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathlocale.darwin.3.2.patch
More file actions
28 lines (25 loc) · 913 Bytes
/
locale.darwin.3.2.patch
File metadata and controls
28 lines (25 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- Lib/locale.py.orig 2011-06-26 14:36:56.000000000 +0200
+++ Lib/locale.py 2011-06-26 14:37:40.000000000 +0200
@@ -349,20 +349,25 @@
If normalization fails, the original name is returned
unchanged.
If the given encoding is not known, the function defaults to
the default encoding for the locale code just like setlocale()
does.
"""
# Normalize the locale name and extract the encoding
fullname = localename.lower()
+
+ if fullname in ('utf8', 'utf-8'):
+ localename = 'en_US.utf-8'
+ fullname = localename.lower()
+
if ':' in fullname:
# ':' is sometimes used as encoding delimiter.
fullname = fullname.replace(':', '.')
if '.' in fullname:
langname, encoding = fullname.split('.')[:2]
fullname = langname + '.' + encoding
else:
langname = fullname
encoding = ''