From 0eb047ca33b2c3708257d95f8857697fc0403c07 Mon Sep 17 00:00:00 2001 From: Medley <198984680+maplemedley@users.noreply.github.com> Date: Mon, 3 Mar 2025 20:33:42 +0100 Subject: [PATCH] Disable debug-breaking locale workaround when debugging (#15859) --- src/gettext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gettext.cpp b/src/gettext.cpp index 59ce2409c..7cb4a7763 100644 --- a/src/gettext.cpp +++ b/src/gettext.cpp @@ -171,8 +171,13 @@ void init_gettext(const char *path, const std::string &configured_language, #if CHECK_CLIENT_BUILD() // Hack to force gettext to see the right environment - if (current_language != configured_language) - MSVC_LocaleWorkaround(argc, argv); + if (current_language != configured_language) { + // Disabled when debugger is present as it can break debugging + if (!IsDebuggerPresent()) + MSVC_LocaleWorkaround(argc, argv); + else + actionstream << "Debugger detected. Skipping MSVC_LocaleWorkaround." << std::endl; + } #else errorstream << "*******************************************************" << std::endl; errorstream << "Can't apply locale workaround for server!" << std::endl;