From 2ed683d477a547dcab2a554d0a1e95e3f4a35d48 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 14 Dec 2011 16:18:30 +0100 Subject: cp65001 is broken --- module/Utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'module/Utils.py') 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) -- cgit v1.2.3