Apply mojibake magic to test runner, too.

This commit is contained in:
Jeroen van Rijn
2026-09-02 15:25:40 +02:00
parent b969878bdf
commit 16ba9e964c
2 changed files with 20 additions and 0 deletions

View File

@@ -267,6 +267,10 @@ runner :: proc(internal_tests: []Internal_Test) -> bool {
}
}
when ODIN_OS == .Windows {
set_utf8_codepage()
defer restore_old_codepage()
}
// `-vet` needs parameters to be shadowed by themselves first as an
// explicit declaration, to allow the next line to work.

View File

@@ -0,0 +1,16 @@
#+private
#+build windows
package testing
import win32 "core:sys/windows"
old_console_codepage: win32.CODEPAGE
set_utf8_codepage :: proc() {
old_console_codepage = win32.GetConsoleOutputCP()
win32.SetConsoleOutputCP(win32.CODEPAGE(65001))
}
restore_old_codepage :: proc() {
win32.SetConsoleOutputCP(old_console_codepage)
}