diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2011-12-14 16:18:30 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2011-12-14 16:18:30 +0100 |
commit | 2ed683d477a547dcab2a554d0a1e95e3f4a35d48 (patch) | |
tree | 8dafe6796dcbba5c8a2aca99a0dc35deaf8d9ad8 /module/Utils.py | |
parent | fix input encoding in setup (diff) | |
download | pyload-2ed683d477a547dcab2a554d0a1e95e3f4a35d48.tar.xz |
cp65001 is broken
Diffstat (limited to 'module/Utils.py')
-rw-r--r-- | module/Utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/Utils.py b/module/Utils.py index 1f4f8c047..9c0856e2a 100644 --- a/module/Utils.py +++ b/module/Utils.py @@ -61,6 +61,16 @@ if sys.getfilesystemencoding() == 'ANSI_X3.4-1968': else: fs_encode = fs_decode = lambda x: x # do nothing +def getConsoleEncoding(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" + + return enc def compare_time(start, end): start = map(int, start) |