mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[RTL]
- Implement IS_TEXT_UNICODE_DBCS_LEADBYTE flag * Fixes 4 new tests in advapi32_apitest svn path=/trunk/; revision=72488
This commit is contained in:
@@ -1307,11 +1307,6 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
||||
}
|
||||
}
|
||||
|
||||
if (lo_byte_diff < 127 && !hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_ASCII16;
|
||||
}
|
||||
|
||||
if (NlsMbCodePageTag)
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
@@ -1333,9 +1328,27 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
||||
weight = 2;
|
||||
else
|
||||
weight = 1;
|
||||
|
||||
if (*pf && (*pf & IS_TEXT_UNICODE_DBCS_LEADBYTE))
|
||||
out_flags |= IS_TEXT_UNICODE_DBCS_LEADBYTE;
|
||||
}
|
||||
}
|
||||
|
||||
if (lo_byte_diff < 127 && !hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_ASCII16;
|
||||
}
|
||||
|
||||
if (hi_byte_diff && !lo_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_ASCII16;
|
||||
}
|
||||
|
||||
if ((weight * lo_byte_diff) < hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_STATISTICS;
|
||||
}
|
||||
|
||||
/* apply some statistical analysis */
|
||||
if ((flags & IS_TEXT_UNICODE_STATISTICS) &&
|
||||
((weight * hi_byte_diff) < lo_byte_diff))
|
||||
@@ -1378,16 +1391,6 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hi_byte_diff && !lo_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_ASCII16;
|
||||
}
|
||||
|
||||
if ((weight * lo_byte_diff) < hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_STATISTICS;
|
||||
}
|
||||
}
|
||||
|
||||
if (pf)
|
||||
|
||||
Reference in New Issue
Block a user