]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch #424066
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 May 2001 17:02:43 +0000 (17:02 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 May 2001 17:02:43 +0000 (17:02 +0000)
(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

index 54064c7064c9b705642245f1cb07c08783ef656f..1b69297e1d0e1464197178f8e1434d0c295ee8b3 100644 (file)
@@ -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