Windows console apps do not set the codepage to UTF-8 anymore; use -d:nimSetUtf8CodePage to re-enable this feature

This commit is contained in:
Andreas Rumpf
2016-10-18 17:57:02 +02:00
parent f176128f07
commit b389f82d12

View File

@@ -3676,7 +3676,7 @@ template closureScope*(body: untyped): untyped =
when defined(nimconfig):
include "system/nimscript"
when defined(windows) and appType == "console" and not defined(nimconfig):
when defined(windows) and appType == "console" and defined(nimSetUtf8CodePage):
proc setConsoleOutputCP(codepage: cint): cint {.stdcall, dynlib: "kernel32",
importc: "SetConsoleOutputCP".}
discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage