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:
@@ -21,6 +21,7 @@
|
||||
#include "wx/rawbmp.h"
|
||||
|
||||
#include "wx/gtk/private/object.h"
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
@@ -677,7 +678,7 @@ bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalett
|
||||
default: break;
|
||||
}
|
||||
return type_name &&
|
||||
gdk_pixbuf_save(GetPixbuf(), name.fn_str(), type_name, NULL, NULL);
|
||||
gdk_pixbuf_save(GetPixbuf(), wxGTK_CONV_FN(name), type_name, NULL, NULL);
|
||||
}
|
||||
|
||||
bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type )
|
||||
@@ -691,7 +692,7 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type )
|
||||
{
|
||||
wxUnusedVar(type); // The type is detected automatically by GDK.
|
||||
|
||||
*this = wxBitmap(gdk_pixbuf_new_from_file(name.fn_str(), NULL));
|
||||
*this = wxBitmap(gdk_pixbuf_new_from_file(wxGTK_CONV_FN(name), NULL));
|
||||
}
|
||||
|
||||
return IsOk();
|
||||
|
Reference in New Issue
Block a user