X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6becc1e617c65cde68e7e6fcdad27e366bf51792..4e3762c9e23a318702f361d572a12df2e6e8e1c9:/include/wx/string.h diff --git a/include/wx/string.h b/include/wx/string.h index cb8d6bccfe..95d440a362 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1383,7 +1383,13 @@ public: #define wxStringToStdWstringRetType wxStdWideString wxStdWideString ToStdWstring() const { +#if wxUSE_UNICODE_WCHAR + wxScopedWCharBuffer buf = + wxScopedWCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length()); +#else // !wxUSE_UNICODE_WCHAR wxScopedWCharBuffer buf(wc_str()); +#endif + return wxStdWideString(buf.data(), buf.length()); } #endif