summaryrefslogtreecommitdiffstats
path: root/module/Utils.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-14 17:27:59 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-14 17:27:59 +0100
commit72e06ea42a02d68627839017f124cfd883623e77 (patch)
treeb5e2cad30c5fe484a1dee86d59fe2298934577d9 /module/Utils.py
parentcp65001 is broken (diff)
downloadpyload-72e06ea42a02d68627839017f124cfd883623e77.tar.xz
pyLoad 0.4.9
Diffstat (limited to 'module/Utils.py')
-rw-r--r--module/Utils.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/module/Utils.py b/module/Utils.py
index 9c0856e2a..c965e33c4 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -49,7 +49,7 @@ def save_join(*args):
# File System Encoding functions:
# Use fs_encode before accesing files on disk, it will encode the string properly
-if sys.getfilesystemencoding() == 'ANSI_X3.4-1968':
+if sys.getfilesystemencoding().startswith('ANSI'):
def fs_encode(string):
try:
string = string.encode('utf-8')
@@ -61,14 +61,13 @@ if sys.getfilesystemencoding() == 'ANSI_X3.4-1968':
else:
fs_encode = fs_decode = lambda x: x # do nothing
-def getConsoleEncoding(enc):
+def get_console_encoding(enc):
if os.name == "nt":
if enc == "cp65001": # aka UTF-8
- print "ERROR: Windows codepage 65001 is not supported."
- exit()
- elif enc == "ascii":
- print "WARNING: Your console's encoding was identified as ASCII. Forcing UTF-8 instead."
- enc = "UTF-8"
+ print "WARNING: Windows codepage 65001 is not supported."
+ enc = "cp850"
+ else:
+ enc = "utf8"
return enc