Author: dchapyshev
Date: Mon Sep 5 19:14:22 2016
New Revision: 72586
URL:
http://svn.reactos.org/svn/reactos?rev=72586&view=rev
Log:
[RTL]
- It is impossible to look for multi byte char in single byte table
Modified:
trunk/reactos/sdk/lib/rtl/unicode.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] Mon Sep 5 19:14:22 2016
@@ -515,7 +515,6 @@
{
WCHAR UnicodeChar;
WCHAR OemChar;
- UCHAR Index;
/* If multi-byte code page present */
if (NlsMbOemCodePageTag)
@@ -528,18 +527,20 @@
if (NlsOemLeadByteInfo[HIBYTE(OemChar)])
Offset = NlsOemLeadByteInfo[HIBYTE(OemChar)];
- Index = LOBYTE(OemChar) + Offset;
+ /* Receive Unicode character from the table */
+ UnicodeChar = RtlUpcaseUnicodeChar(NlsOemToUnicodeTable[LOBYTE(OemChar) +
Offset]);
+
+ /* Receive OEM character from the table */
+ OemChar = NlsUnicodeToMbOemTable[UnicodeChar];
}
else
{
- Index = NlsUnicodeToOemTable[*Char];
- }
-
- /* Receive Unicode character from the table */
- UnicodeChar = RtlUpcaseUnicodeChar(NlsOemToUnicodeTable[Index]);
-
- /* Receive OEM character from the table */
- OemChar = NlsUnicodeToOemTable[UnicodeChar];
+ /* Receive Unicode character from the table */
+ UnicodeChar =
RtlUpcaseUnicodeChar(NlsOemToUnicodeTable[(UCHAR)NlsUnicodeToOemTable[*Char]]);
+
+ /* Receive OEM character from the table */
+ OemChar = NlsUnicodeToOemTable[UnicodeChar];
+ }
/* Not valid character, failed */
if (OemChar == NlsOemDefaultChar)