From f358979d358df842ac07b48f5f20ffc4efd486a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20D=C3=B6nmez?= Date: Tue, 29 Mar 2016 13:59:04 +0300 Subject: [PATCH] Check for C/POSIX locale just after we truncate language string This way we can correctly detect C.UTF-8 as C locale. See https://github.com/wxWidgets/wxWidgets/pull/262 (cherry picked from commit 467dc72fc21fcede41f518f40e9b1efa18285926) --- src/common/intl.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 745cff6944..8a77c3d522 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -629,11 +629,6 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value) return wxLANGUAGE_ENGLISH_US; } - if ( langFull == wxS("C") || langFull == wxS("POSIX") ) - { - // default C locale is English too - return wxLANGUAGE_ENGLISH_US; - } #endif // the language string has the following form @@ -669,6 +664,12 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value) langFull.Truncate(posEndLang); } + if ( langFull == wxS("C") || langFull == wxS("POSIX") ) + { + // default C locale is English too + return wxLANGUAGE_ENGLISH_US; + } + // do we have just the language (or sublang too)? const bool justLang = langFull.find('_') == wxString::npos;