From 2ec6905c69c73f908533697c770c690657f4371c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 2 Jun 2001 11:25:21 +0000 Subject: [PATCH] fixed new charset detection code (langinfo.h not included in intl.cpp; langinfo.h not neccessary in strconv.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/intl.cpp | 6 ++++++ src/common/strconv.cpp | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) 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); diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index f60201d7d3..b8982301a6 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -44,9 +44,6 @@ #ifdef HAVE_ICONV_H #include #endif -#ifdef HAVE_LANGINFO_H - #include -#endif #ifdef __WXMSW__ #include -- 2.45.2