Dmitry Timoshkov wrote:
"Vitaly Lipatov" <[EMAIL PROTECTED]> wrote:
> Most likely the real fixes in your patch are changing CP_ACP to
CP_UNIXCP
> and getting rid of hardcoded vkkeyscan_table. Do you have an
evidence that
> ncurses is so much broken that it really can't handle UTF-8? Does
it work
> if you change the locale to a not UTF-8 one?
Dmitry, as I already post in this thread, we have test program which
does not print correctly ever in UTF-8 locale.
Usual ncurses works in 8-bit locales like koi8-r correctly, but we
can't output in utf8 locale.
Have you been able to see any cyrillic text in wineconsole with the
curses
backend at all? Even after changing CP_ACP to CP_UNIXCP I don't see
anything.
This is with a KOI8-R locale. We need to make this configuration work
first.
Hello!
With This patch you will be able to see cyrillic symbols in wineconsole.
Changelog:
Add convertig from multibyte to widechar for correctly assignment in
FillSimpleChar function.
Have Removed check in Refresh function : if(ch >127...), because
cyrillic symbols has code more that 127.
Index: programs/wineconsole/curses.c
===================================================================
RCS file: /home/wine/wine/programs/wineconsole/curses.c,v
retrieving revision 1.31
diff -u -p -u -r1.31 curses.c
--- programs/wineconsole/curses.c 10 Jan 2007 11:37:39 -0000 1.31
+++ programs/wineconsole/curses.c 12 Jan 2007 13:47:17 -0000
@@ -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;
+ unsigned 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 = (unsigned char) inchar;
+ MultiByteToWideChar(CP_UNIXCP, 0,(char*)&ch,1,&ir[numEvent].Event.KeyEvent.uChar.UnicodeChar, 1);
ir[numEvent + 1] = ir[numEvent];
ir[numEvent + 1].Event.KeyEvent.bKeyDown = 0;