mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-03 10:40:20 +00:00
Apply mojibake magic to test runner, too.
This commit is contained in:
@@ -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.
|
||||
|
||||
16
core/testing/terminal_window.odin
Normal file
16
core/testing/terminal_window.odin
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user