+#ifdef __WXWINCE__
+ // FIXME-CE: there is no setlocale() in CE CRT, use SetThreadLocale()?
+ wxUnusedVar(category);
+ wxUnusedVar(locale);
+
+ return NULL;
+#else // !__WXWINCE__
+#ifdef __WXMAC__
+ char *rv = NULL ;
+ if ( locale != NULL && locale[0] == 0 )
+ {
+ // the attempt to use newlocale(LC_ALL_MASK, "", NULL);
+ // here in order to deduce the language along the environment vars rules
+ // lead to strange crashes later...
+
+ // we have to emulate the behaviour under OS X
+ wxCFRef<CFLocaleRef> userLocaleRef(CFLocaleCopyCurrent());
+ wxCFStringRef str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode)));
+ wxString langFull = str.AsString()+"_";
+ str.reset(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode)));
+ langFull += str.AsString();
+ rv = setlocale(category, langFull.c_str());
+ }
+ else
+ rv = setlocale(category, locale);
+#else