kernelbase: Use translated Unicode default char to check invalid chars.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48288 Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3bb92d7773
commit
a85bc781d3
|
@ -1005,12 +1005,15 @@ static void test_undefined_byte_char(void)
|
|||
LPCSTR str;
|
||||
BOOL is_error;
|
||||
} testset[] = {
|
||||
{ 37, "\x6f", FALSE },
|
||||
{ 874, "\xdd", TRUE },
|
||||
{ 932, "\xfe", TRUE },
|
||||
{ 932, "\x80", FALSE },
|
||||
{ 932, "\x81\x45", FALSE },
|
||||
{ 936, "\xff", TRUE },
|
||||
{ 949, "\xff", TRUE },
|
||||
{ 950, "\xff", TRUE },
|
||||
{ 1252, "?", FALSE },
|
||||
{ 1252, "\x90", FALSE },
|
||||
{ 1253, "\xaa", TRUE },
|
||||
{ 1255, "\xff", TRUE },
|
||||
|
|
|
@ -1044,12 +1044,12 @@ static int check_invalid_chars( const CPTABLEINFO *info, const unsigned char *sr
|
|||
{
|
||||
if (srclen == 1) break; /* partial char, error */
|
||||
if (info->DBCSOffsets[off + src[1]] == info->UniDefaultChar &&
|
||||
((src[0] << 8) | src[1]) != info->TransDefaultChar) break;
|
||||
((src[0] << 8) | src[1]) != info->TransUniDefaultChar) break;
|
||||
src++;
|
||||
srclen--;
|
||||
continue;
|
||||
}
|
||||
if (info->MultiByteTable[*src] == info->UniDefaultChar && *src != info->TransDefaultChar)
|
||||
if (info->MultiByteTable[*src] == info->UniDefaultChar && *src != info->TransUniDefaultChar)
|
||||
break;
|
||||
if (is_private_use_area_char( info->MultiByteTable[*src] )) break;
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ static int check_invalid_chars( const CPTABLEINFO *info, const unsigned char *sr
|
|||
{
|
||||
for ( ; srclen; src++, srclen-- )
|
||||
{
|
||||
if (info->MultiByteTable[*src] == info->UniDefaultChar && *src != info->TransDefaultChar)
|
||||
if (info->MultiByteTable[*src] == info->UniDefaultChar && *src != info->TransUniDefaultChar)
|
||||
break;
|
||||
if (is_private_use_area_char( info->MultiByteTable[*src] )) break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue