Always use UTF-8 for file names passed to GTK+ functions under MSW.

When building wxGTK under MSW, always use UTF-8 as file name encoding because
GTK+ doesn't use G_FILENAME_ENCODING there.

Add a helper wxGTK_CONV_FN() macro to hide the difference between the
platforms.

Closes #14035.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-04-08 18:10:29 +00:00
parent 527f168b34
commit c282e47d8f
8 changed files with 29 additions and 12 deletions

View File

@@ -288,7 +288,7 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
const wxString dir = fn.GetPath();
if ( !dir.empty() )
{
gtk_file_chooser_set_current_folder(file_chooser, dir.fn_str());
gtk_file_chooser_set_current_folder(file_chooser, wxGTK_CONV_FN(dir));
}
const wxString fname = fn.GetFullName();
@@ -296,7 +296,7 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
{
if ( !fname.empty() )
{
gtk_file_chooser_set_current_name(file_chooser, fname.fn_str());
gtk_file_chooser_set_current_name(file_chooser, wxGTK_CONV_FN(fname));
}
#if GTK_CHECK_VERSION(2,7,3)
@@ -309,7 +309,7 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
if ( !fname.empty() )
{
gtk_file_chooser_set_filename(file_chooser,
fn.GetFullPath().fn_str());
wxGTK_CONV_FN(fn.GetFullPath()));
}
}