#if wxUSE_UNICODE
if ( ws )
{
- wxCharBuffer buf(wxString(ws).mb_str(conv));
+ wxCharBuffer buf = conv.cWC2MB(ws, (size_t)-1, NULL);
CPPUNIT_ASSERT( strcmp(buf, s) == 0 );
}
#else // wxUSE_UNICODE
if ( s )
{
- wxWCharBuffer wbuf(wxString(s).wc_str(conv));
+ wxWCharBuffer wbuf = conv.cMB2WC(s, (size_t)-1, NULL);
if ( ws )
CPPUNIT_ASSERT( wx_wcscmp(wbuf, ws) == 0 );
else
- CPPUNIT_ASSERT_EQUAL( L'\0', *wbuf );
+ CPPUNIT_ASSERT_EQUAL( (wchar_t *)NULL, wbuf.data() );
}
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
}
static const StringConversionData utf16data[] =
{
#ifdef wxHAVE_U_ESCAPE
- { "\x04\x1f\x04\x40\x04\x38\x04\x32\x04\x35\x04\x42",
+ { "\x04\x1f\x04\x40\x04\x38\x04\x32\x04\x35\x04\x42\0\0",
L"\u041f\u0440\u0438\u0432\u0435\u0442" },
#endif
- { "\0f\0o\0o", L"foo" },
+ { "\0f\0o\0o\0\0", L"foo" },
};
wxCSConv conv(wxFONTENCODING_UTF16BE);