summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 6a9b52d24..c2b45e01d 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3670,3 +3670,8 @@ template closureScope*(body: untyped): untyped =
 
 when defined(nimconfig):
   include "system/nimscript"
+
+when defined(windows) and appType == "console":
+  proc setConsoleOutputCP(codepage: cint): cint {.stdcall, dynlib: "kernel32",
+    importc: "SetConsoleOutputCP".}
+  discard setConsoleOutputCP(65001) # 65001 - utf-8 codepage
\ No newline at end of file