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
This commit is contained in:
parent
c3d62ecf55
commit
2ec6905c69
@ -34,6 +34,9 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef HAVE_LANGINFO_H
|
||||||
|
#include <langinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// wxWindows
|
// wxWindows
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
@ -955,7 +958,10 @@ wxString wxLocale::GetSystemEncodingName()
|
|||||||
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
|
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
|
||||||
// GNU libc provides current character set this way (this conforms
|
// GNU libc provides current character set this way (this conforms
|
||||||
// to Unix98)
|
// to Unix98)
|
||||||
|
char *oldLocale = strdup(setlocale(LC_CTYPE, NULL));
|
||||||
|
setlocale(LC_CTYPE, "");
|
||||||
char *alang = nl_langinfo(CODESET);
|
char *alang = nl_langinfo(CODESET);
|
||||||
|
setlocale(LC_CTYPE, oldLocale);
|
||||||
if (alang)
|
if (alang)
|
||||||
{
|
{
|
||||||
encname = wxConvLibc.cMB2WX(alang);
|
encname = wxConvLibc.cMB2WX(alang);
|
||||||
|
@ -44,9 +44,6 @@
|
|||||||
#ifdef HAVE_ICONV_H
|
#ifdef HAVE_ICONV_H
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LANGINFO_H
|
|
||||||
#include <langinfo.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user