// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "intl.h"
#endif
}
}
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
+ (void)convertEncoding; // get rid of warnings about unused parameter
}
wxString wxMsgCatalogFile::GetCharset() const
// TODO: how to find languageId
// SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
#else
- m_pszOldLocale = wxStrdup(wxSetlocale(LC_ALL, szLocale));
+ m_pszOldLocale = wxSetlocale(LC_ALL, szLocale);
+ if ( m_pszOldLocale )
+ m_pszOldLocale = wxStrdup(m_pszOldLocale);
#endif
if ( m_pszOldLocale == NULL )
static wxWCharBuffer wxSetlocaleTryUTF(int c, const wxChar *lc)
{
wxMB2WXbuf l = wxSetlocale(c, lc);
- if ( lc && lc[0] != 0 && !l )
+ if ( !l && lc && lc[0] != 0 )
{
wxString buf(lc);
- buf += wxT(".utf8");
- l = wxSetlocale(c, buf.c_str());
+ wxString buf2;
+ buf2 = buf + wxT(".UTF-8");
+ l = wxSetlocale(c, buf2.c_str());
+ if ( !l )
+ {
+ buf2 = buf + wxT(".utf-8");
+ l = wxSetlocale(c, buf2.c_str());
+ }
+ if ( !l )
+ {
+ buf2 = buf + wxT(".UTF8");
+ l = wxSetlocale(c, buf2.c_str());
+ }
+ if ( !l )
+ {
+ buf2 = buf + wxT(".utf8");
+ l = wxSetlocale(c, buf2.c_str());
+ }
}
return l;
}
// to Unix98)
char *oldLocale = strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "");
- char *alang = nl_langinfo(CODESET);
+ const char *alang = nl_langinfo(CODESET);
setlocale(LC_CTYPE, oldLocale);
free(oldLocale);