diff --git a/src/msw/uilocale.cpp b/src/msw/uilocale.cpp index 21615c1b49..8e7eb5dbed 100644 --- a/src/msw/uilocale.cpp +++ b/src/msw/uilocale.cpp @@ -205,13 +205,11 @@ wxUILocaleImpl* wxUILocaleImpl::CreateForLanguage(const wxLanguageInfo& info) } /* static */ -int wxUILocale::CompareStrings(const wxString& lhs, const wxString& rhs, const wxLocaleIdent& locale_id) +int wxUILocale::CompareStrings(const wxString& lhs, const wxString& rhs, const wxLocaleIdent& localeId) { int ret = wxMSWCompareStringEx( - locale_id.IsDefault() ? LOCALE_NAME_USER_DEFAULT - : static_cast( - locale_id.GetName().wc_str() - ), + localeId.IsDefault() ? LOCALE_NAME_USER_DEFAULT + : static_cast(localeId.GetName().wc_str()), 0, // Maybe we need LINGUISTIC_IGNORECASE here static_cast(lhs.wc_str()), -1, static_cast(rhs.wc_str()), -1, diff --git a/src/osx/core/uilocale.mm b/src/osx/core/uilocale.mm index d6a1f081e3..f718fd907c 100644 --- a/src/osx/core/uilocale.mm +++ b/src/osx/core/uilocale.mm @@ -133,13 +133,13 @@ wxUILocaleImpl* wxUILocaleImpl::CreateForLanguage(const wxLanguageInfo& info) } /* static */ -int wxUILocale::CompareStrings(const wxString& lhs, const wxString& rhs, const wxLocaleIdent& locale_id) +int wxUILocale::CompareStrings(const wxString& lhs, const wxString& rhs, const wxLocaleIdent& localeId) { NSString *ns_lhs = [NSString stringWithCString:lhs.ToStdString(wxConvUTF8).c_str() encoding:NSUTF8StringEncoding]; NSString *ns_rhs = [NSString stringWithCString:rhs.ToStdString(wxConvUTF8).c_str() encoding:NSUTF8StringEncoding]; - NSString *ns_locale_id = [NSString stringWithCString:locale_id.GetName().ToStdString(wxConvUTF8).c_str() + NSString *ns_locale_id = [NSString stringWithCString:localeId.GetName().ToStdString(wxConvUTF8).c_str() encoding:NSUTF8StringEncoding]; NSInteger options = NSCaseInsensitiveSearch; // Maybe also NSDiacriticInsensitiveSearch? NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:ns_locale_id];