Bug 30549 - unicode hex codes in keyboard layouts has stopped working in recent versions
Summary: unicode hex codes in keyboard layouts has stopped working in recent versions
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/XKB (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Daniel Stone
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 15:02 UTC by Hedayat Vatankhah
Modified: 2010-10-11 01:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Hedayat Vatankhah 2010-10-01 15:02:04 UTC
As described in this report: https://bugs.freedesktop.org/show_bug.cgi?id=30548
recently I've tried Fedora 14 beta (which uses xorg-xserver 1.9), and I found that in keyboard layouts, characters which are defined using unicode hex characters instead of X keysym names doesn't work any longer. This issue causes some layouts to not work properly.
Comment 1 Hedayat Vatankhah 2010-10-05 23:25:49 UTC
Well, apparently UXXXX style key codes do work, but 0x100XXXX style key codes has stopped working. I wonder if this is intentional.
Comment 2 James Cloos 2010-10-06 03:21:44 UTC
I still cannot find anything other than:

  2e7a18b6a617b9b4bfcea2d36f2bd2d7e0c4a3dd

which touches the conversions.

It seemed like there were a change which attempted to prevent the leak
which occur when dealing with the Uxxxx keysym conversions, but that
affects XKeysymToString(3) and remains.  (It is a *hard* problem.)

I just tried out this simple test which runs XStringToKeysym(3) on
argv[1] and printf(3)s the result.  I get correct results for every
type of input string I tried:

// Run XStringToKeysym(3) on argv[1] and return the result
#include <stdio.h>
#include <X11/Xlib.h>
int main (int argc, char *argv[]) {
    KeySym key;
    if (argc < 2) {
        fprintf (stderr, "Usage: %s <string>\n", argv[0]);
        return -1;
    }
    key = XStringToKeysym(argv[1]);
    printf ("%ld\t%#lx\n", key, key);
}


It only needs to link against -lX11.

If that works on the affected systems then, AFAICT, the bug can
not be in libX11.

Someone still needs to bisect.
Comment 3 Hedayat Vatankhah 2010-10-06 05:37:14 UTC
On my Fedora 13 system with libX11-1.3.1 (which does *NOT* have the mentioned problem), these are the results:

[hedayat@localhost]~% ./a.out 10006f1  
0	0
[hedayat@localhost]~% ./a.out 0x10006f1
0	0
[hedayat@localhost]~% ./a.out U06f1      
16778993	0x10006f1
[hedayat@localhost]~% ./a.out Farsi_1    
16778993	0x10006f1


I get the same results in F14 with libX11-1.3.4 (which is affected by the mentioned bug). 
BTW, as I've mentioned in bug #30548, I've also replaced libX11-1.3.4 files in Fedora 14 with libraries from my Fedora 13 (libX11-1.3.1) and it still has the same problem. So, I also think that the problem is not in libX11 (or at least, it's been triggered by changes in somewhere else).
Comment 4 Julien Cristau 2010-10-06 06:02:10 UTC
On Wed, Oct  6, 2010 at 05:37:14 -0700, bugzilla-daemon@freedesktop.org wrote:

> BTW, as I've mentioned in bug #30548, I've also replaced libX11-1.3.4 files in
> Fedora 14 with libraries from my Fedora 13 (libX11-1.3.1) and it still has the
> same problem. So, I also think that the problem is not in libX11 (or at least,
> it's been triggered by changes in somewhere else).
> 
Could be xkbcomp.
Comment 5 Hedayat Vatankhah 2010-10-10 01:03:50 UTC
Is XStringToKeysym expected to return the correct code for 0x100XXXX codes?! I guess that previously, the one who called this function were skipping this function call when facing with 0x100XXXX codes, but it doesn't do it right now. So, maybe XStringToKeysym should be fixed to return the same hex code when encountering 0x100XXXX codes?
Comment 6 James Cloos 2010-10-10 13:53:37 UTC
> Is XStringToKeysym expected to return the correct code for 0x100XXXX codes?!

The current version does.  A string like "0x100CA23" returns the integer 0x100CA23.
Comment 7 Hedayat Vatankhah 2010-10-10 15:45:59 UTC
Aha, confirmed. It works in the latest git. BTW, the problem still persists. Where should this bug go from this point? :(
Comment 8 Daniel Stone 2010-10-10 20:23:27 UTC
Well, since the bug is fixed and has been for over three months, I'm going to mark it FIXED ...
Comment 9 Daniel Stone 2010-10-10 20:24:25 UTC
(In reply to comment #7)
> Aha, confirmed. It works in the latest git. BTW, the problem still persists.
> Where should this bug go from this point? :(

Sorry, I should've been a little more clear - xkbcomp from git master any time after July 9th fixes the issue.  I believe F14 had a broken xkbcomp for a while, but an update has been pushed there too.
Comment 10 Hedayat Vatankhah 2010-10-11 01:36:57 UTC
:) Thanks


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.