Fix setlocale for win32 and MacOS X
This commit is contained in:
1 parent
af3f779521
commit
24e1f3afa7
1 file changed
+5
@@ -1034,9 +1034,14 @@ class OpenBalanceSheet(Wizard):
|
||||
encoding = 'UTF-8'
|
||||
if encoding == 'cp1252':
|
||||
encoding = '1252'
|
||||
if not encoding:
|
||||
encoding = 'UTF-8'
|
||||
try:
|
||||
if os.name == 'nt':
|
||||
os.environ['LANG'] = lang
|
||||
lang = _LOCALE2WIN32.get(lang, lang)
|
||||
elif os.name == 'mac':
|
||||
encoding = 'UTF-8'
|
||||
locale.setlocale(locale.LC_ALL, str(lang + '.' + encoding))
|
||||
except:
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user