fix parsing config file
This commit is contained in:
parent
731de491d2
commit
83c63e85de
|
@ -17,6 +17,7 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import locale
|
||||||
from common import gajim
|
from common import gajim
|
||||||
from common import i18n
|
from common import i18n
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
|
@ -52,7 +53,10 @@ class OptionsParser:
|
||||||
return
|
return
|
||||||
|
|
||||||
for line in fd.readlines():
|
for line in fd.readlines():
|
||||||
line = line.decode('utf-8')
|
try:
|
||||||
|
line = line.decode('utf-8')
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
line = line.decode(locale.getpreferredencoding())
|
||||||
self.read_line(line)
|
self.read_line(line)
|
||||||
|
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
Loading…
Reference in New Issue