Skip to content
Snippets Groups Projects
Commit fa20b215 authored by nkour's avatar nkour
Browse files

use locale.getpreferredencoding() instead of sys.getfsencoding in decode_string

parent c494b7f5
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment