X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..2ef31e80ee0e9c597ffca0fd7a0eb9d018a2f51b:/src/common/wxchar.cpp?ds=inline diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 1ef378cda3..c2deb9b203 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -63,7 +63,7 @@ size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n) #if wxUSE_WCSRTOMBS // don't know if it's really needed (or if we can pass NULL), but better safe // than quick - mbstate_t mbstate; + mbstate_t mbstate; return mbsrtowcs((wchar_t *) NULL, &psz, 0, &mbstate); #else // !GNU libc return mbstowcs((wchar_t *) NULL, psz, 0); @@ -86,7 +86,7 @@ size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *pwz, size_t n) #if wxUSE_WCSRTOMBS // don't know if it's really needed (or if we can pass NULL), but better safe // than quick - mbstate_t mbstate; + mbstate_t mbstate; return wcsrtombs((char *) NULL, &pwz, 0, &mbstate); #else // !GNU libc return wcstombs((char *) NULL, pwz, 0); @@ -189,11 +189,11 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt #endif #ifndef wxSetlocale -WXDLLEXPORT wxChar * wxSetlocale(int category, const wxChar *locale) +WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale) { - setlocale(category, wxConvLibc.cWX2MB(locale)); - // FIXME - return (wxChar *)NULL; + char *localeOld = setlocale(category, wxConvLibc.cWX2MB(locale)); + + return wxWCharBuffer(wxConvLibc.cMB2WC(localeOld)); } #endif