diff --git a/src/osx/core/uilocale.mm b/src/osx/core/uilocale.mm index f739fa32d2..978cdf7625 100644 --- a/src/osx/core/uilocale.mm +++ b/src/osx/core/uilocale.mm @@ -131,7 +131,13 @@ wxUILocaleImplCF::Use() wxString wxUILocaleImplCF::GetName() const { - return wxCFStringRef::AsString([m_nsloc localeIdentifier]); + wxString name = wxCFStringRef::AsString([m_nsloc localeIdentifier]); + + // Check for the special case of the "empty" system locale, see CreateStdC() + if ( name.empty() ) + name = "C"; + + return name; } wxLocaleIdent @@ -209,7 +215,12 @@ wxUILocaleImplCF::GetLayoutDirection() const /* static */ wxUILocaleImpl* wxUILocaleImpl::CreateStdC() { - return wxUILocaleImplCF::Create(wxLocaleIdent().Language("C")); + // This is an "empty" locale, but it seems to correspond rather well to the + // "C" locale under POSIX systems and using localeWithLocaleIdentifier:@"C" + // wouldn't be much better as we'd still need a hack for it in GetName() + // because the locale names are always converted to lower case, while we + // really want to return "C" rather than "c" as the name of this one. + return new wxUILocaleImplCF([NSLocale systemLocale]); } /* static */