X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dccce9eae10e099d791cc055dd02d3dda731778e..161f4f7380e945b0769ad5f7122df55b8777396a:/src/common/intl.cpp diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 42e01b6274..3b0a992d89 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -34,6 +34,9 @@ #include #include #include +#ifdef HAVE_LANGINFO_H + #include +#endif // wxWindows #ifndef WX_PRECOMP @@ -955,7 +958,10 @@ wxString wxLocale::GetSystemEncodingName() #if defined(HAVE_LANGINFO_H) && defined(CODESET) // GNU libc provides current character set this way (this conforms // to Unix98) + char *oldLocale = strdup(setlocale(LC_CTYPE, NULL)); + setlocale(LC_CTYPE, ""); char *alang = nl_langinfo(CODESET); + setlocale(LC_CTYPE, oldLocale); if (alang) { encname = wxConvLibc.cMB2WX(alang); @@ -1006,8 +1012,8 @@ wxFontEncoding wxLocale::GetSystemEncoding() wxString encname = GetSystemEncodingName(); if ( !encname.empty() ) { - return wxFontMapper::CharsetToEncoding(encname, - FALSE /* not interactive */); + return wxTheFontMapper-> + CharsetToEncoding(encname, FALSE /* not interactive */); } #endif // Win32/Unix