Author: dchapyshev
Date: Sun Aug 28 11:05:01 2016
New Revision: 72486
URL:
http://svn.reactos.org/svn/reactos?rev=72486&view=rev
Log:
[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
Modified:
trunk/reactos/sdk/lib/rtl/unicode.c
trunk/rostests/apitests/advapi32/IsTextUnicode.c
Modified: trunk/reactos/sdk/lib/rtl/unicode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/rtl/unicode.c?rev=…
==============================================================================
--- trunk/reactos/sdk/lib/rtl/unicode.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/rtl/unicode.c [iso-8859-1] Sun Aug 28 11:05:01 2016
@@ -1295,6 +1295,21 @@
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)
Modified: trunk/rostests/apitests/advapi32/IsTextUnicode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/advapi32/IsTextU…
==============================================================================
--- trunk/rostests/apitests/advapi32/IsTextUnicode.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/advapi32/IsTextUnicode.c [iso-8859-1] Sun Aug 28 11:05:01
2016
@@ -80,7 +80,7 @@
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 */