X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/803c55373484d1e2bfed85b46cbbfff8bfad1276..161f4f7380e945b0769ad5f7122df55b8777396a:/src/common/intl.cpp diff --git a/src/common/intl.cpp b/src/common/intl.cpp index aea952ed77..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);