mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user