From 388bc6ba0466d412b78e93f682ad3f44bbd50e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20HERVIER?= Date: Thu, 28 Aug 2014 13:39:40 +0200 Subject: [PATCH] #708 : Use default locale encoding Use locale endoding else this generate error in GU : as default time format can have non ascii char on non english locale, but using ascii in locale can generate UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 : In PyBitmessage/src/bitmessageqt/__init__.py" l10n.formatTimestamp()) In PyBitmessage/src/l10n.py", line 81, in formatTimestamp return unicode(timestring, encoding) --- src/l10n.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/l10n.py b/src/l10n.py index e3e8d07e..f9c9b456 100644 --- a/src/l10n.py +++ b/src/l10n.py @@ -18,7 +18,7 @@ language = DEFAULT_LANGUAGE try: import locale - encoding = locale.getpreferredencoding(False) or DEFAULT_ENCODING + encoding = locale.getpreferredencoding(True) or DEFAULT_ENCODING language = locale.getlocale()[0] or locale.getdefaultlocale()[0] or DEFAULT_LANGUAGE except: logger.exception('Could not determine language or encoding')