X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/602a857b25b6b0a07ab26f13815810cafbe05672..4f1cf94b942cbf62616a8a1a066b1a13ff6af792:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 77ace82f76..d154b3c937 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -340,7 +340,7 @@ wxString::SubstrBufFromMB wxString::ConvertStr(const char *psz, size_t nLength, return SubstrBufFromMB("", 0); // and then to UTF-8: - SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvUTF8())); + SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvStrictUTF8())); // widechar -> UTF-8 conversion isn't supposed to ever fail: wxASSERT_MSG( buf.data, _T("conversion to UTF-8 failed") ); @@ -382,9 +382,12 @@ const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const const wxWCharBuffer wxString::wc_str() const { - return wxMBConvUTF8().cMB2WC(m_impl.c_str(), - m_impl.length() + 1 /* size, not length */, - NULL); + return wxMBConvStrictUTF8().cMB2WC + ( + m_impl.c_str(), + m_impl.length() + 1, // size, not length + NULL + ); } const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const @@ -395,10 +398,12 @@ const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const // FIXME-UTF8: use wc_str() here once we have buffers with length size_t wcLen; - wxWCharBuffer wcBuf( - wxMBConvUTF8().cMB2WC(m_impl.c_str(), - m_impl.length() + 1 /* size, not length */, - &wcLen)); + wxWCharBuffer wcBuf(wxMBConvStrictUTF8().cMB2WC + ( + m_impl.c_str(), + m_impl.length() + 1, // size + &wcLen + )); if ( !wcLen ) return wxCharBuffer(""); @@ -981,7 +986,7 @@ wxString wxString::FromAscii(const char *ascii, size_t len) wxString res; { - wxImplStringBuffer buf(res, len); + wxStringInternalBuffer buf(res, len); wxStringCharType *dest = buf; for ( ; len > 0; --len ) @@ -999,7 +1004,7 @@ wxString wxString::FromAscii(const char *ascii, size_t len) wxString wxString::FromAscii(const char *ascii) { - return FromAscii(ascii, strlen(ascii)); + return FromAscii(ascii, wxStrlen(ascii)); } wxString wxString::FromAscii(const char ascii) @@ -1639,7 +1644,7 @@ int wxString::PrintfV(const wxString& format, va_list argptr) #if wxUSE_STL_BASED_WXSTRING typedef wxStringTypeBuffer Utf8Buffer; #else - typedef wxImplStringBuffer Utf8Buffer; + typedef wxStringInternalBuffer Utf8Buffer; #endif #endif