зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1255433 - Read mozconfig as mbcs on Windows. r=gps
When writing e.g. Japanese text files on Windows, the text is encoded in mbcs. So if a mozconfig is edited this way, and contains non ascii characters, they won't be utf-8 as we're currently trying to decode them, but mbcs.
This commit is contained in:
Родитель
ad56d4e463
Коммит
0c528f1ec6
|
@ -358,7 +358,8 @@ class MozconfigLoader(object):
|
|||
# XXX This is an ugly hack. Data may be lost from things
|
||||
# like environment variable values.
|
||||
# See https://bugzilla.mozilla.org/show_bug.cgi?id=831381
|
||||
line = line.decode('utf-8', 'ignore')
|
||||
line = line.decode('mbcs' if sys.platform == 'win32' else 'utf-8',
|
||||
'ignore')
|
||||
|
||||
if not line:
|
||||
continue
|
||||
|
|
Загрузка…
Ссылка в новой задаче