mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 09:39:43 +01:00
Allow UTF-8 console output on Windows (for -console)
Right now, Windows assumes all our console output is code page ????. That means our UTF-8 output appears mangled. (I ran into this while testing IME text input by outputting strings to the console) For a moment I was scared we'd need to do UTF-16 conversions and call Windows-specific print functions like WriteConsoleW() in our vlog functions, but fortunately SetConsoleOutputCP(CP_UTF8) works just fine.
This commit is contained in:
parent
36dbb0f73a
commit
98d1a38d7f
1 changed files with 5 additions and 0 deletions
|
@ -220,6 +220,11 @@ void vlog_open_console(void)
|
|||
}
|
||||
|
||||
check_color_support();
|
||||
|
||||
if (!SetConsoleOutputCP(CP_UTF8))
|
||||
{
|
||||
vlog_warn("Could not set code page for console output to UTF-8.");
|
||||
}
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue