]> git.saurik.com Git - wxWidgets.git/commitdiff
fix conversion of wxString to data in AddFileWithMimeType(wxString, wxString) overloa...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 28 Apr 2009 12:23:48 +0000 (12:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 28 Apr 2009 12:23:48 +0000 (12:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fs_mem.cpp

index 9cd5628f86cee4063583a3b131a1a8d66b11f36c..28b43e826f0aebeb4c6a8dab3ba002501aa25a65 100644 (file)
@@ -186,8 +186,14 @@ void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename,
                                                 const wxString& textdata,
                                                 const wxString& mimetype)
 {
+#if wxUSE_UNICODE
+    const wxScopedCharBuffer data(textdata.To8BitData());
+#else
+    const wxString& data = textdata;
+#endif
+
     AddFileWithMimeType(filename,
-                        (const void*) textdata.mb_str(), textdata.length(),
+                        static_cast<const char *>(data), data.length(),
                         mimetype);
 }