#endif
#include "wx/crt.h"
+#include "wx/strconv.h" // wxMBConv::cWC2MB()
#define _ISOC9X_SOURCE 1 // to get vsscanf()
#define _BSD_SOURCE 1 // to still get strdup()
#include <stdlib.h>
#include <string.h>
+#ifndef __WXPALMOS5__
#ifndef __WXWINCE__
#include <time.h>
#include <locale.h>
#else
#include "wx/msw/wince/time.h"
#endif
+#endif // !__WXPALMOS5__
#ifndef WX_PRECOMP
#include "wx/string.h"
#include "wx/mac/corefoundation/cfref.h"
#include <CoreFoundation/CFLocale.h>
#include "wx/mac/corefoundation/cfstring.h"
+ #include <xlocale.h>
#endif
#if wxUSE_WCHAR_T
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());
- wxMacCFStringHolder str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode)));
+ wxCFStringRef str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode)));
wxString langFull = str.AsString()+"_";
- str.Assign(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode)));
+ str.reset(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode)));
langFull += str.AsString();
rv = setlocale(category, langFull.c_str());
}