From a27216c145b1b13ad863e49e5400778ad608640f Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 5 Sep 2026 19:18:44 -0400 Subject: Fix Windows locale and error messages Signed-off-by: Andrew Opalach --- src/common.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common.c') diff --git a/src/common.c b/src/common.c index 4358945..e772a2f 100644 --- a/src/common.c +++ b/src/common.c @@ -80,7 +80,12 @@ bool nn_common_init(const char *thread_name) { if (thread_name) nn_thread_set_name(thread_name); + // https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=msvc-170#utf-8-support +#if defined NAUNET_ON_WINDOWS && !defined NAUNET_WIN32_COMPAT_MODE + if (!setlocale(LC_ALL, ".UTF8")) return false; +#else if (!setlocale(LC_ALL, "")) return false; +#endif al_set_print(al_print_default, NULL); -- cgit v1.2.3-101-g0448