From 23ca6e208f0301f6a1fe96e6b10b9f6b8bfe8e16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 15 May 2001 17:02:43 +0000 Subject: [PATCH] applied patch #424066 (a bit better attempt to detect system encoding in absence of LANGINFO) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 54064c7064..1b69297e1d 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -758,12 +758,18 @@ void wxCSConv::LoadNow() // try to see if it's in the environment variables // (in most cases this won't work, but I was out of ideas) wxChar *lang = wxGetenv(wxT("LC_ALL")); - if (!lang) + wxChar *dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL; + if (!dot) + { lang = wxGetenv(wxT("LC_CTYPE")); - if (!lang) + dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL; + } + if (!dot) + { lang = wxGetenv(wxT("LANG")); - wxChar *dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL; - if (dot) + dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL; + } + if (dot) SetName(dot+1); } #endif -- 2.50.0