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:
Mike Hommey 2016-03-11 16:34:52 +09:00
Родитель ad56d4e463
Коммит 0c528f1ec6
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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