Module: wine Branch: master Commit: 6ee85a61f29fcf8cab92a71c1fb8f2fb2be13c62 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6ee85a61f29fcf8cab92a71c1f...
Author: Anatoly Lyutin vostok@etersoft.ru Date: Fri Jan 12 18:03:34 2007 +0300
wineconsole: Add support for non-latin symbols with curses.
---
programs/wineconsole/curses.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c index 14637b1..30ae89a 100644 --- a/programs/wineconsole/curses.c +++ b/programs/wineconsole/curses.c @@ -365,7 +365,7 @@ static void WCCURSES_Refresh(const struc { WideCharToMultiByte(CP_UNIXCP, 0, &cell[x].Char.UnicodeChar, 1, &ch, 1, NULL, NULL); - attr = ((BYTE)ch < 32 || (BYTE)ch > 127) ? 32 : (BYTE)ch; + attr = ((BYTE)ch < 32) ? 32 : (BYTE)ch;
if (cell[x].Attributes & FOREGROUND_RED) attr |= COLOR_PAIR(COLOR_RED); if (cell[x].Attributes & FOREGROUND_BLUE) attr |= COLOR_PAIR(COLOR_BLUE); @@ -487,6 +487,7 @@ static unsigned WCCURSES_FillSimpleChar( { unsigned vk; unsigned inchar; + char ch; unsigned numEvent = 0; DWORD cks = 0;
@@ -538,8 +539,9 @@ static unsigned WCCURSES_FillSimpleChar( ir[numEvent].Event.KeyEvent.dwControlKeyState |= LEFT_ALT_PRESSED; ir[numEvent].Event.KeyEvent.wVirtualKeyCode = vk; ir[numEvent].Event.KeyEvent.wVirtualScanCode = mapvkey_0[vk & 0x00ff]; /* VirtualKeyCodes to ScanCode */ - ir[numEvent].Event.KeyEvent.uChar.UnicodeChar = (unsigned char)inchar;
+ ch = inchar; + MultiByteToWideChar(CP_UNIXCP, 0,&ch,1,&ir[numEvent].Event.KeyEvent.uChar.UnicodeChar, 1); ir[numEvent + 1] = ir[numEvent]; ir[numEvent + 1].Event.KeyEvent.bKeyDown = 0;