Hello Shachar, Tuesday, August 12, 2003, 12:15:51 AM, you wrote: SS> Dmitry Timoshkov wrote:
BTW, what wrong happens if your keyboard was misdetected? In the current CVS all national characters should work fine regardless what keyboard layout was detected. Is that only a warning message which makes you worry?
SS> Does this also apply to UTF-8? I, for one, still can't get any SS> characters recognized when the locale is UTF-8.
With the current CVS, I can't get any Cyrillic input with any setting of LANG: ru_RU.KOI8-R, ru_RU.UTF-8, ru_RU.CP1251, and en_US.UTF-8. Only ? characters are input. -- Best regards, Phil mailto:phil(a)newstar.rinet.ru
"Phil Krylov" <phil(a)newstar.rinet.ru> wrote:
With the current CVS, I can't get any Cyrillic input with any setting of LANG: ru_RU.KOI8-R, ru_RU.UTF-8, ru_RU.CP1251, and en_US.UTF-8. Only ? characters are input.
Even if you set LC_ALL=ru_RU.KOI8-R? A good test is to run 'xev' and see whether it "works" for you. -- Dmitry.
Hello Dmitry, Tuesday, August 12, 2003, 3:23:14 PM, you wrote: DT> "Phil Krylov" <phil(a)newstar.rinet.ru> wrote:
With the current CVS, I can't get any Cyrillic input with any setting of LANG: ru_RU.KOI8-R, ru_RU.UTF-8, ru_RU.CP1251, and en_US.UTF-8. Only ? characters are input.
DT> Even if you set LC_ALL=ru_RU.KOI8-R? A good test is to run 'xev' and DT> see whether it "works" for you. Ah, it must be my fault - I used LANG instead of LC_ALL. Using LC_ALL=ru_RU.UTF-8 and your latest patch (ignoring XK_ModeSwitch), my keyboard started working perfectly. Thanks! -- Best regards, Phil mailto:phil(a)newstar.rinet.ru
Hello, Tuesday, August 12, 2003, 7:14:16 PM, I wrote: PK> Ah, it must be my fault - I used LANG instead of LC_ALL. Using PK> LC_ALL=ru_RU.UTF-8 and your latest patch (ignoring XK_ModeSwitch), my PK> keyboard started working perfectly. sorry, i made a mistake. ru_RU.KOI8-R works, while ru_RU.UTF-8 (which is my default setting) and en_US.UTF-8 don't. PK> Thanks! -- Best regards, Phil mailto:phil(a)newstar.rinet.ru
Hello, Tuesday, August 12, 2003, 7:46:14 PM, I wrote: PK>> Ah, it must be my fault - I used LANG instead of LC_ALL. Using PK>> LC_ALL=ru_RU.UTF-8 and your latest patch (ignoring XK_ModeSwitch), my PK>> keyboard started working perfectly. PK> sorry, i made a mistake. ru_RU.KOI8-R works, while ru_RU.UTF-8 (which PK> is my default setting) and en_US.UTF-8 don't. But ru_RU.UTF-8 works with the following patch to keyboard.c (but it won't work on XFree86 3.x): --- keyboard.c 2003-08-12 19:23:29.000000000 +0400 +++ keyboard.c-mine 2003-08-12 19:39:21.000000000 +0400 @@ -1840,7 +1840,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); if (xic) - ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL); + ret = Xutf8LookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL); else ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL); wine_tsx11_unlock(); @@ -1911,8 +1911,15 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT /* perform translation to unicode */ if(ret) { - TRACE_(key)("Translating char 0x%02x to unicode\n", *(BYTE *)lpChar); - ret = MultiByteToWideChar(CP_UNIXCP, 0, lpChar, ret, bufW, bufW_size); + if (xic) + { + TRACE_(key)("Translating string %.*s from UTF-8 to UCS-2\n", + ret, lpChar); + ret = MultiByteToWideChar(CP_UTF8, 0, lpChar, ret, bufW, bufW_size); + } else { + TRACE_(key)("Translating char 0x%02x to unicode\n", *(BYTE *)lpChar); + ret = MultiByteToWideChar(CP_UNIXCP, 0, lpChar, ret, bufW, bufW_size); + } } } PK>> Thanks! -- Best regards, Phil mailto:phil(a)newstar.rinet.ru
"Phil Krylov" <phil(a)newstar.rinet.ru> wrote:
But ru_RU.UTF-8 works with the following patch to keyboard.c (but it won't work on XFree86 3.x):
--- keyboard.c 2003-08-12 19:23:29.000000000 +0400 +++ keyboard.c-mine 2003-08-12 19:39:21.000000000 +0400 @@ -1840,7 +1840,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode);
if (xic) - ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL); + ret = Xutf8LookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL); else ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL);
It must be a bug in the XmbLookupString implementation of XFree86. It seems that it doesn't respect UTF-8 locale, while works fine in others. Could you try to investigate what really returns XmbLookupString for UTF-8 locale? -- Dmitry.
Hello Dmitry, Wednesday, August 13, 2003, 6:28:21 AM, you wrote: DT> Could you try to investigate what really returns XmbLookupString for DT> UTF-8 locale? It returns 0. -- Best regards, Phil mailto:phil(a)newstar.rinet.ru
"Phil Krylov" <phil(a)newstar.rinet.ru> wrote:
DT> Could you try to investigate what really returns XmbLookupString for DT> UTF-8 locale?
It returns 0.
What version of XFree86 are you using? Could you send me a log using current cvs: +x11drv,+event,+key,+keyboard? -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Phil Krylov