From fa20b21507a09c1b6643f2a98a96a85b7e221a2c Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 2 Nov 2006 13:42:51 +0000 Subject: [PATCH] use locale.getpreferredencoding() instead of sys.getfsencoding in decode_string --- src/common/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/helpers.py b/src/common/helpers.py index 56d436b49..9ee58cd91 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -17,6 +17,7 @@ ## import sre +import locale import os import subprocess import urllib @@ -553,7 +554,7 @@ def decode_string(string): if isinstance(string, unicode): return string # by the time we go to iso15 it better be the one else we show bad characters - encodings = (sys.getfilesystemencoding(), 'utf-8', 'iso-8859-15') + encodings = (locale.getpreferredencoding(), 'utf-8', 'iso-8859-15') for encoding in encodings: try: string = string.decode(encoding)