This commit is contained in:
Andreas Rumpf 2019-08-17 21:19:57 +02:00 • committed by GitHub
commit 7cb31455ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 9 deletions

View file

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