[kernel32][console] Change CP in converting (function ReadConsoleA)
Anatoly Lyutin
vostok at etersoft.ru
Fri Jan 12 08:41:00 CST 2007
Have been Changed CP_ACP on GetConsoleOutputCP() in WideCharToMultiByte,
because we have to read in encoding of console, not always CP_ACP.
Chngelog:
Have been Changed CP_ACP on GetConsoleOutputCP() in ReadConsoleA() and
ScrollConsoleScreenBufferA().
-------------- next part --------------
Index: dlls/kernel32/console.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel32/console.c,v
retrieving revision 1.2
diff -u -p -u -r1.2 console.c
--- dlls/kernel32/console.c 13 Oct 2006 10:27:18 -0000 1.2
+++ dlls/kernel32/console.c 24 Nov 2006 12:56:13 -0000
@@ -1200,7 +1199,7 @@ BOOL WINAPI ReadConsoleA(HANDLE hConsole
BOOL ret;
if ((ret = ReadConsoleW(hConsoleInput, ptr, nNumberOfCharsToRead, &ncr, NULL)))
- ncr = WideCharToMultiByte(CP_ACP, 0, ptr, ncr, lpBuffer, nNumberOfCharsToRead, NULL, NULL);
+ ncr = WideCharToMultiByte(GetConsoleOutputCP(), 0, ptr, ncr, lpBuffer, nNumberOfCharsToRead, NULL, NULL);
if (lpNumberOfCharsRead) *lpNumberOfCharsRead = ncr;
HeapFree(GetProcessHeap(), 0, ptr);
@@ -2258,7 +2257,7 @@ BOOL WINAPI ScrollConsoleScreenBufferA(H
CHAR_INFO ciw;
ciw.Attributes = lpFill->Attributes;
- MultiByteToWideChar(CP_ACP, 0, &lpFill->Char.AsciiChar, 1, &ciw.Char.UnicodeChar, 1);
+ MultiByteToWideChar(GetConsoleOutputCP(), 0, &lpFill->Char.AsciiChar, 1, &ciw.Char.UnicodeChar, 1);
return ScrollConsoleScreenBufferW(hConsoleOutput, lpScrollRect, lpClipRect,
dwDestOrigin, &ciw);
More information about the wine-patches
mailing list