Don't end converting prematurely on encountering consecutive NULs.
Don't stop converting subsequent chunks just because the length of one of them was 0: this can happen if the first character of a string is a NUL or if there are two (or more) NULs in it later. Simply remove the check for this and continue as usual even in this case. Also add a unit test verifying that we do translate NULs in input into NULs in output. Closes #16620. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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 )
|
||||
|
Reference in New Issue
Block a user