mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 21:23:58 +00:00
[RTL]
- Implement IS_TEXT_UNICODE_ILLEGAL_CHARS and IS_TEXT_UNICODE_ASCII16 flags * It fixes 7 tests for the IsTextUnicode function in advapi32_apitest. All tests passed now svn path=/trunk/; revision=72486
This commit is contained in:
parent
25d05a1982
commit
af19896deb
2 changed files with 16 additions and 1 deletions
|
@ -1295,6 +1295,21 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
|||
|
||||
last_lo_byte = lo_byte;
|
||||
last_hi_byte = hi_byte;
|
||||
|
||||
switch (s[i])
|
||||
{
|
||||
case 0xFFFE: /* Reverse BOM */
|
||||
case UNICODE_NULL:
|
||||
case 0x0A0D: /* ASCII CRLF (packed into one word) */
|
||||
case 0xFFFF: /* Unicode 0xFFFF */
|
||||
out_flags |= IS_TEXT_UNICODE_ILLEGAL_CHARS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lo_byte_diff < 127 && !hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_ASCII16;
|
||||
}
|
||||
|
||||
if (NlsMbCodePageTag)
|
||||
|
|
|
@ -80,7 +80,7 @@ START_TEST(IsTextUnicode)
|
|||
NEW_TEST(L"\xFFFE" L"UNICODE String 5 Привет!", IS_TEXT_UNICODE_STATISTICS, 0, FALSE),
|
||||
NEW_TEST(L"\xFFFE" L"UNICODE String 5 Привет!", INVALID_FLAG, 0, FALSE),
|
||||
|
||||
// 28
|
||||
// 31
|
||||
/* Reverse BOM */
|
||||
NEW_TEST(L"UNICODE S" L"\xFFFE" L"tring 5 Привет!", IS_TEXT_UNICODE_ILLEGAL_CHARS, IS_TEXT_UNICODE_ILLEGAL_CHARS, FALSE),
|
||||
/* UNICODE_NUL */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue