mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Linux binary build: If setting system default locale fails, try setting locale to en_US.UTF-8 instead
This commit is contained in:
parent
10c4751b52
commit
eac89c5439
@ -318,7 +318,11 @@ class LinuxFreeze(Command):
|
|||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
def set_default_encoding():
|
def set_default_encoding():
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
try:
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
except:
|
||||||
|
print 'WARNING: Failed to set default libc locale, using en_US'
|
||||||
|
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
|
||||||
enc = locale.getdefaultlocale()[1]
|
enc = locale.getdefaultlocale()[1]
|
||||||
if not enc:
|
if not enc:
|
||||||
enc = locale.nl_langinfo(locale.CODESET)
|
enc = locale.nl_langinfo(locale.CODESET)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user