add Win32_CODEPAGES enum and enable utf8 console output on win32 (#2670)

* add Win32_CODEPAGES enum and enable utf8 console output on win32

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Book-reader
2026-01-14 11:00:01 +13:00
committed by GitHub
parent 827ad18ef4
commit c73c7cb2a3
6 changed files with 210 additions and 10 deletions

View File

@@ -7,6 +7,9 @@
#ifdef __OpenBSD__
#include <sys/resource.h>
#endif
#if PLATFORM_WINDOWS
#include <windows.h>
#endif
bool debug_log = false;
@@ -36,6 +39,11 @@ int main_real(int argc, const char *argv[])
getrlimit(RLIMIT_DATA, &l);
l.rlim_cur = l.rlim_max;
setrlimit(RLIMIT_DATA, &l);
#endif
#if PLATFORM_WINDOWS
// Set the console input and output codepage to utf8 to handle utf8 text correctly
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
#endif
bench_begin();