From 791310fa5d310b73d7521b8f25ffb34656d87636 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 25 Oct 2023 17:21:11 -0700 Subject: [PATCH] Provide error code if SetConsoleOutputCP fails According to the Win32 documentation, GetLastError provides extended error information if SetConsoleOutputCP fails. --- desktop_version/src/Vlogging.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Vlogging.c b/desktop_version/src/Vlogging.c index 0b10506d..5e61bf57 100644 --- a/desktop_version/src/Vlogging.c +++ b/desktop_version/src/Vlogging.c @@ -223,7 +223,11 @@ void vlog_open_console(void) if (!SetConsoleOutputCP(CP_UTF8)) { - vlog_warn("Could not set code page for console output to UTF-8."); + vlog_warn( + "Could not set code page for console output to UTF-8: " + "SetConsoleOutputCP() failed with %d", + GetLastError() + ); } } #endif /* _WIN32 */