Skip to content

Commit a3f19c3

Browse files
Remove mojibake in the locale aliases mapping. (GH-6716)
1 parent cedc9b7 commit a3f19c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/locale.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ def getpreferredencoding(do_setlocale = True):
923923
'bo_in': 'bo_IN.UTF-8',
924924
'bokmal': 'nb_NO.ISO8859-1',
925925
'bokm\xe5l': 'nb_NO.ISO8859-1',
926-
'bokm\xef\xbf\xbd': 'nb_NO.ISO8859-1',
927926
'br': 'br_FR.ISO8859-1',
928927
'br_fr': 'br_FR.ISO8859-1',
929928
'brx_in': 'brx_IN.UTF-8',
@@ -1072,7 +1071,6 @@ def getpreferredencoding(do_setlocale = True):
10721071
'fr_fr': 'fr_FR.ISO8859-1',
10731072
'fr_lu': 'fr_LU.ISO8859-1',
10741073
'fran\xe7ais': 'fr_FR.ISO8859-1',
1075-
'fran\xef\xbf\xbdis': 'fr_FR.ISO8859-1',
10761074
'fre_fr': 'fr_FR.ISO8859-1',
10771075
'french': 'fr_FR.ISO8859-1',
10781076
'french.iso88591': 'fr_CH.ISO8859-1',

Tools/i18n/makelocalealias.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def parse(filename):
1919

2020
with open(filename, encoding='latin1') as f:
2121
lines = list(f)
22+
# Remove mojibake in /usr/share/X11/locale/locale.alias.
23+
# b'\xef\xbf\xbd' == '\ufffd'.encode('utf-8')
24+
lines = [line for line in lines if '\xef\xbf\xbd' not in line]
2225
data = {}
2326
for line in lines:
2427
line = line.strip()

0 commit comments

Comments
 (0)