-#ifdef __UNIX__
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
- // GNU libc provides current character set this way
- char *alang = nl_langinfo(CODESET);
- if (alang)
- {
- SetName(wxConvLibc.cMB2WX(alang));
- }
- else
-#endif
- {
- // if we can't get at the character set directly,
- // 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"));
- wxChar *dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL;
- if (!dot)
- {
- lang = wxGetenv(wxT("LC_CTYPE"));
- dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL;
- }
- if (!dot)
- {
- lang = wxGetenv(wxT("LANG"));
- dot = lang ? wxStrchr(lang, wxT('.')) : (wxChar *)NULL;
- }
- if (dot)
- SetName(dot+1);
- }
-#endif