// ----------------------------------------------------------------------------
// TODO: Do we want to include the null char in the stream? If so then
// ----------------------------------------------------------------------------
// TODO: Do we want to include the null char in the stream? If so then
- : m_str(s), m_buf(wxMBConvUTF8().cWX2MB(s).release()), m_len(strlen(m_buf))
+ // FIXME-UTF8: use wxCharBufferWithLength if we have it
+ : m_str(s), m_buf(s.utf8_str()), m_len(strlen(m_buf))
// ----------------------------------------------------------------------------
// getlength
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// getlength
// ----------------------------------------------------------------------------
// the part of the string we have here may be incomplete, i.e. it can stop
// in the middle of an UTF-8 character and so converting it would fail; if
// this is the case, accumulate the part which we failed to convert until
// the part of the string we have here may be incomplete, i.e. it can stop
// in the middle of an UTF-8 character and so converting it would fail; if
// this is the case, accumulate the part which we failed to convert until
if ( wbuf )
{
// conversion succeeded, clear the unconverted buffer
m_unconv = wxMemoryBuffer(0);
if ( wbuf )
{
// conversion succeeded, clear the unconverted buffer
m_unconv = wxMemoryBuffer(0);
-#else // !wxUSE_UNICODE_WCHAR
- // no recoding necessary, the data is supposed to already be in UTF-8 (if
- // supported) or ASCII otherwise
+#else // !wxUSE_UNICODE
+ // no recoding necessary