From 91cb0b487572f8a5b9c46ba2a73755864e9be3b2 Mon Sep 17 00:00:00 2001 From: JulianSmart Date: Mon, 29 May 2017 13:17:27 +0100 Subject: [PATCH] =?UTF-8?q?Restore=20previous=20GetLocaleName=20behaviour?= =?UTF-8?q?=20except=20for=20Norwegian=20Bokm=C3=A5l=20since=20wxLocale::I?= =?UTF-8?q?nit=20fails=20otherwise=20for=20VS2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/intl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 24f49d433e..005d6bc23e 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -151,7 +151,9 @@ wxString wxLanguageInfo::GetLocaleName() const wxChar buffer[256]; buffer[0] = wxT('\0'); - if ( wxGetWinVersion() >= wxWinVersion_Vista ) + // wxLANGUAGE_NORWEGIAN_BOKMAL crashes mbstowcs, but using LOCALE_SNAME can fail + // for e.g. wxLANGUAGE_ENGLISH, so at least limit the damage. + if ( Language == wxLANGUAGE_NORWEGIAN_BOKMAL && wxGetWinVersion() >= wxWinVersion_Vista ) { if ( ::GetLocaleInfo(lcid, LOCALE_SNAME, buffer, WXSIZEOF(buffer)) ) {