mirror of
https://github.com/python/cpython
synced 2024-09-05 16:38:56 +00:00
Remove mojibake in the locale aliases mapping. (GH-6716)
This commit is contained in:
parent
cedc9b7420
commit
a3f19c3f52
|
@ -923,7 +923,6 @@ def getpreferredencoding(do_setlocale = True):
|
|||
'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 @@ def getpreferredencoding(do_setlocale = True):
|
|||
'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',
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue