also fixed WriteString() to work correctly when outputting UTF-16/32: can't use strlen() with these encodings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -414,10 +414,10 @@ void wxTextOutputStream::WriteString(const wxString& string)
|
|||||||
out << c;
|
out << c;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We must not write the trailing NULL here
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxCharBuffer buffer = m_conv->cWC2MB( out );
|
// note that we must not write the trailing NUL here
|
||||||
m_output.Write( (const char*) buffer, strlen( (const char*) buffer ) );
|
wxCharBuffer buffer = m_conv->cWC2MB(out, out.length(), &len);
|
||||||
|
m_output.Write(buffer, len + 1 - m_conv->GetMBNulLen());
|
||||||
#else
|
#else
|
||||||
m_output.Write(out.c_str(), out.length() );
|
m_output.Write(out.c_str(), out.length() );
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user