COMMON: Fix conversion to UTF32 for short strings

Testcase: convert 1-byte encoded single character string from 125X to
UTF32, e.g. "=".

Expected result: got widestring, first dword contains "=", next dword
contains "\0"

Actual result: got widestring, first dword contains "=", second dword
contains garbage, next dword contains "\0"

Reference implementation:
http://www-personal.umich.edu/~bazald/l/api/_s_d_l__iconv_8c_source.html
, line 887
This commit is contained in:
lolbot-iichan 2020-02-24 03:24:24 +03:00 committed by Eugene Sandulenko
parent 73c2d2015d
commit 3e738f7734

View File

@ -183,8 +183,8 @@ char *Encoding::convertIconv(const char *to, const char *from, const char *strin
return nullptr;
size_t inSize = length;
size_t outSize = inSize;
size_t stringSize = inSize > 4 ? inSize : 4;
size_t outSize = stringSize;
#ifdef ICONV_USES_CONST