[kernel32/console.c] A really very small fix.

Anatoly vostok at etersoft.ru
Fri Nov 24 07:55:17 CST 2006


Hi!

This fix change CodePage parameter  in MultiByteToWideChar() type 
function from CP_ACP to return of GetConsoleOutputCP(). Now unicode 
symbols correct outs in wineconsole application (ex: Far).

Changelog:
Change codepage parameter in ReadConsoleA function.
Change codepage parameter in ScrollConsoleScreenBufferA function.
-------------- 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-devel mailing list