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:
parent
f176128f07
commit
b389f82d12
1 changed files with 1 additions and 1 deletions
|
|
@ -3676,7 +3676,7 @@ template closureScope*(body: untyped): untyped =
|
||||||
when defined(nimconfig):
|
when defined(nimconfig):
|
||||||
include "system/nimscript"
|
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",
|
proc setConsoleOutputCP(codepage: cint): cint {.stdcall, dynlib: "kernel32",
|
||||||
importc: "SetConsoleOutputCP".}
|
importc: "SetConsoleOutputCP".}
|
||||||
discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage
|
discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue