diff options
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) |