- wxLogDebug(_T("There were memory leaks.\n"));
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
+ // (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;
+
+#if wxUSE_UNICODE
+ // gtk_init() wants UTF-8, not wchar_t, so convert
+ int i;
+ char **argvGTK = new char *[argc + 1];
+ for ( i = 0; i < argc; i++ )
+ {
+ argvGTK[i] = wxStrdupA(wxConvUTF8.cWX2MB(argv[i]));