deploy-ng: fix Windows codec error when console codepage is 0

This commit is contained in:
rdb 2017-12-21 14:08:34 +01:00
parent 58917e6746
commit a512c44366

View File

@ -69,6 +69,10 @@ static struct _inittab extensions[] = {
#if defined(_WIN32) && PY_VERSION_HEX < 0x03060000 #if defined(_WIN32) && PY_VERSION_HEX < 0x03060000
static int supports_code_page(UINT cp) { static int supports_code_page(UINT cp) {
if (cp == 0) {
cp = GetACP();
}
/* Shortcut, because we know that these encodings are bundled by default-- /* Shortcut, because we know that these encodings are bundled by default--
* see FreezeTool.py and Python's encodings/aliases.py */ * see FreezeTool.py and Python's encodings/aliases.py */
if (cp != 0 && cp != 1252 && cp != 367 && cp != 437 && cp != 850 && cp != 819) { if (cp != 0 && cp != 1252 && cp != 367 && cp != 437 && cp != 850 && cp != 819) {