X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c263eb03846c1b1439bf67d1d831255024278adf..653d7a50e5d9cc02146c5c79a0cbf41e2a1f6cfb:/src/gtk1/app.cpp diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index e722bcace7..c9f166377f 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -80,7 +80,6 @@ #include - //----------------------------------------------------------------------------- // global data //----------------------------------------------------------------------------- @@ -448,6 +447,7 @@ wxApp::wxApp() // this is NULL for a "regular" wxApp, but is set (and freed) by a wxGLApp m_glVisualInfo = (void *) NULL; + m_glFBCInfo = (void *) NULL; } wxApp::~wxApp() @@ -606,6 +606,32 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxConvCurrent = (wxMBConv*) NULL; #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T +#ifdef __WXGTK20__ + // decide which conversion to use for the file names + + // (1) this variable exists for the sole purpose of specifying the encoding + // of the filenames for GTK+ programs, so use it if it is set + wxString encName(wxGetenv(_T("G_FILENAME_ENCODING"))); + encName.MakeUpper(); +#if wxUSE_INTL + if (encName.empty()) + { + // (2) if a non default locale is set, assume that the user wants his + // filenames in this locale too + encName = wxLocale::GetSystemEncodingName().Upper(); + // (3) finally use UTF-8 by default + if (encName.empty() || encName == _T("US-ASCII")) + encName = _T("UTF-8"); + wxSetEnv(_T("G_FILENAME_ENCODING"), encName); + } +#else + if (encName.empty()) + encName = _T("UTF-8"); +#endif // wxUSE_INTL + static wxConvBrokenFileNames fileconv(encName); + wxConvFileName = &fileconv; +#endif // __WXGTK20__ + #if wxUSE_UNICODE // gtk_init() wants UTF-8, not wchar_t, so convert int i;