From 4a9da949ce38ae34badc955871568128aedbb051 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Mar 2022 16:10:40 +0100 Subject: [PATCH] Set C locale for wxLANGUAGE_DEFAULT under Unix too This had been done before all the recent wxUILocale-related changed and was still done for non-Unix systems, but not there because we explicitly skipped calling setlocale() in this case with a comment saying that the default locale was already in use -- however this comment was wrong and we do need to call setlocale(LC_ALL, "") in this case for compatibility and consistency. Closes #22212. --- src/unix/uilocale.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/unix/uilocale.cpp b/src/unix/uilocale.cpp index b9ba860e10..c1abb31ebf 100644 --- a/src/unix/uilocale.cpp +++ b/src/unix/uilocale.cpp @@ -258,12 +258,9 @@ wxUILocaleImplUnix::~wxUILocaleImplUnix() void wxUILocaleImplUnix::Use() { - if ( m_locId.IsEmpty() ) - { - // This is the default locale, it is already in use. - return; - } - + // Note that we don't need to test if m_locId is not empty here, as we + // still want to call setlocale() with the empty string to use the default + // locale settings in this case. if ( !wxSetlocaleTryAll(LC_ALL, m_locId) ) { // Some C libraries (namely glibc) still use old ISO 639,