fixed conversion from Unicode in StreamOut() once again

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-10-12 01:23:23 +00:00
parent f4cf4fdab2
commit b26613c25b

View File

@ -822,13 +822,13 @@ wxTextCtrl::StreamOut(wxFontEncoding encoding, bool selectionOnly) const
// decreased by wxRichEditStreamOut
*(wchBuf.data() + data.len) = L'\0';
// now convert to the given encoding (this is a lossful conversion but
// what else can we do)
// now convert to the given encoding (this is a possibly lossful
// conversion but what else can we do)
wxCSConv conv(encoding);
size_t lenNeeded = conv.WC2MB(NULL, wchBuf, len);
if ( lenNeeded )
size_t lenNeeded = conv.WC2MB(NULL, wchBuf, 0);
if ( lenNeeded++ )
{
conv.WC2MB(wxStringBuffer(out, lenNeeded), wchBuf, len);
conv.WC2MB(wxStringBuffer(out, lenNeeded), wchBuf, lenNeeded);
}
}