From: Vadim Zeitlin Date: Tue, 28 Apr 2009 12:23:48 +0000 (+0000) Subject: fix conversion of wxString to data in AddFileWithMimeType(wxString, wxString) overloa... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8f1a82e6bbcd743abf9afff7e871f8324db567f3 fix conversion of wxString to data in AddFileWithMimeType(wxString, wxString) overload in Unicode build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 9cd5628f86..28b43e826f 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -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(data), data.length(), mimetype); }