diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index af447aa631..949f2a71ec 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -232,12 +232,6 @@ wxMBConv::ToWChar(wchar_t *dst, size_t dstLen, if ( !srcEnd ) dstWritten++; - if ( !lenChunk ) - { - // nothing left in the input string, conversion succeeded - break; - } - if ( dst ) { if ( dstWritten > dstLen ) diff --git a/tests/strings/unicode.cpp b/tests/strings/unicode.cpp index 5f2e9dec65..edec58bc19 100644 --- a/tests/strings/unicode.cpp +++ b/tests/strings/unicode.cpp @@ -291,6 +291,10 @@ void UnicodeTestCase::ConversionWithNULs() CPPUNIT_ASSERT( memcmp(theLocalBuffer.data(), L"The\0String", 11 * sizeof(wchar_t)) == 0 ); #endif // wxUSE_UNICODE/!wxUSE_UNICODE + + const char *null4buff = "\0\0\0\0"; + wxString null4str(null4buff, 4); + CPPUNIT_ASSERT_EQUAL( 4, null4str.length() ); } void UnicodeTestCase::ConversionUTF7()