Restore previous GetLocaleName behaviour except for Norwegian Bokmål since wxLocale::Init fails otherwise for VS2010

This commit is contained in:
JulianSmart
2017-05-29 13:17:27 +01:00
parent c1f2bbce5d
commit 91cb0b4875

View File

@@ -151,7 +151,9 @@ wxString wxLanguageInfo::GetLocaleName() const
wxChar buffer[256]; wxChar buffer[256];
buffer[0] = wxT('\0'); 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)) ) if ( ::GetLocaleInfo(lcid, LOCALE_SNAME, buffer, WXSIZEOF(buffer)) )
{ {