[bugfix] make -d:nimSetUtf8CodePage switch work again

This commit is contained in:
Araq
2019-07-01 10:35:52 +02:00
parent d37c4e44d3
commit dd39b11b13

View File

@@ -4468,7 +4468,7 @@ proc substr*(s: string, first = 0): string =
when defined(nimconfig):
include "system/nimscript"
when defined(windows) and appType == "console" and defined(nimSetUtf8CodePage):
when defined(windows) and appType == "console" and defined(nimSetUtf8CodePage) and not defined(nimscript):
proc setConsoleOutputCP(codepage: cint): cint {.stdcall, dynlib: "kernel32",
importc: "SetConsoleOutputCP".}
discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage