summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-05-06 07:52:38 (GMT)
committerGitHub <noreply@github.com>2018-05-06 07:52:38 (GMT)
commita3f19c3f52ddff85dd52eaa01b77b2d50cc9af3f (patch)
treef33c57d75c5cc2bc7828fa5673050dc0de3088fb
parentcedc9b74202d8c1ae39bca261cbb45d42ed54d45 (diff)
downloadcpython-a3f19c3f52ddff85dd52eaa01b77b2d50cc9af3f.zip
cpython-a3f19c3f52ddff85dd52eaa01b77b2d50cc9af3f.tar.gz
cpython-a3f19c3f52ddff85dd52eaa01b77b2d50cc9af3f.tar.bz2
Remove mojibake in the locale aliases mapping. (GH-6716)
-rw-r--r--Lib/locale.py2
-rwxr-xr-xTools/i18n/makelocalealias.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 876d2eb..f3d3973 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -923,7 +923,6 @@ locale_alias = {
'bo_in': 'bo_IN.UTF-8',
'bokmal': 'nb_NO.ISO8859-1',
'bokm\xe5l': 'nb_NO.ISO8859-1',
- 'bokm\xef\xbf\xbd': 'nb_NO.ISO8859-1',
'br': 'br_FR.ISO8859-1',
'br_fr': 'br_FR.ISO8859-1',
'brx_in': 'brx_IN.UTF-8',
@@ -1072,7 +1071,6 @@ locale_alias = {
'fr_fr': 'fr_FR.ISO8859-1',
'fr_lu': 'fr_LU.ISO8859-1',
'fran\xe7ais': 'fr_FR.ISO8859-1',
- 'fran\xef\xbf\xbdis': 'fr_FR.ISO8859-1',
'fre_fr': 'fr_FR.ISO8859-1',
'french': 'fr_FR.ISO8859-1',
'french.iso88591': 'fr_CH.ISO8859-1',
diff --git a/Tools/i18n/makelocalealias.py b/Tools/i18n/makelocalealias.py
index c7ecace..b407a8a 100755
--- a/Tools/i18n/makelocalealias.py
+++ b/Tools/i18n/makelocalealias.py
@@ -19,6 +19,9 @@ def parse(filename):
with open(filename, encoding='latin1') as f:
lines = list(f)
+ # Remove mojibake in /usr/share/X11/locale/locale.alias.
+ # b'\xef\xbf\xbd' == '\ufffd'.encode('utf-8')
+ lines = [line for line in lines if '\xef\xbf\xbd' not in line]
data = {}
for line in lines:
line = line.strip()