{"action":"created","issue":{"url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/58","repository_url":"https://api.github.com/repos/xkbcommon/libxkbcommon","labels_url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/58/comments","events_url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/58/events","html_url":"https://github.com/xkbcommon/libxkbcommon/issues/58","id":318530670,"number":58,"title":"X11->Unicode range","user":{"login":"andrecbarros","id":7326330,"avatar_url":"https://avatars1.githubusercontent.com/u/7326330?v=4","gravatar_id":"","url":"https://api.github.com/users/andrecbarros","html_url":"https://github.com/andrecbarros","followers_url":"https://api.github.com/users/andrecbarros/followers","following_url":"https://api.github.com/users/andrecbarros/following{/other_user}","gists_url":"https://api.github.com/users/andrecbarros/gists{/gist_id}","starred_url":"https://api.github.com/users/andrecbarros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrecbarros/subscriptions","organizations_url":"https://api.github.com/users/andrecbarros/orgs","repos_url":"https://api.github.com/users/andrecbarros/repos","events_url":"https://api.github.com/users/andrecbarros/events{/privacy}","received_events_url":"https://api.github.com/users/andrecbarros/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-27T19:53:40Z","updated_at":"2018-04-28T16:30:52Z","closed_at":null,"author_association":"NONE","body":"There is a bug with Keysym to Unicode translation for values of Keysym > 0x01000000. The real range is a bit more strict than the code that deals with it on xkb_keysym_to_utf32 use.\r\n\r\nTo speed up the translations of Keysyms with values inside keysymtab, I suggest the use of range boundaries, like what you can find on my fork.\r\n\r\nBest regards,\r\nAndré"},"comment":{"url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/comments/385188447","html_url":"https://github.com/xkbcommon/libxkbcommon/issues/58#issuecomment-385188447","issue_url":"https://api.github.com/repos/xkbcommon/libxkbcommon/issues/58","id":385188447,"user":{"login":"bluetech","id":1223550,"avatar_url":"https://avatars3.githubusercontent.com/u/1223550?v=4","gravatar_id":"","url":"https://api.github.com/users/bluetech","html_url":"https://github.com/bluetech","followers_url":"https://api.github.com/users/bluetech/followers","following_url":"https://api.github.com/users/bluetech/following{/other_user}","gists_url":"https://api.github.com/users/bluetech/gists{/gist_id}","starred_url":"https://api.github.com/users/bluetech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluetech/subscriptions","organizations_url":"https://api.github.com/users/bluetech/orgs","repos_url":"https://api.github.com/users/bluetech/repos","events_url":"https://api.github.com/users/bluetech/events{/privacy}","received_events_url":"https://api.github.com/users/bluetech/received_events","type":"User","site_admin":false},"created_at":"2018-04-28T16:30:52Z","updated_at":"2018-04-28T16:30:52Z","author_association":"OWNER","body":"Let's leave performance optimizations aside for moment, we can discuss them afterwards.\r\n\r\nRegarding the functional changes, what do you think about the following diff for fixing the bug?\r\n\r\n```diff\r\ndiff --git a/src/keysym-utf.c b/src/keysym-utf.c\r\nindex 1ccfc0e..99f467e 100644\r\n--- a/src/keysym-utf.c\r\n+++ b/src/keysym-utf.c\r\n@@ -881,9 +881,10 @@ xkb_keysym_to_utf32(xkb_keysym_t keysym)\r\n         keysym == XKB_KEY_KP_Enter || keysym == XKB_KEY_KP_Equal)\r\n         return keysym & 0x7f;\r\n \r\n-    /* also check for directly encoded 24-bit UCS characters */\r\n-    if ((keysym & 0xff000000) == 0x01000000)\r\n-        return keysym & 0x00ffffff;\r\n+    /* also check for directly encoded Unicode keysyms */\r\n+    if (0x01000100 <= keysym && keysym <= 0x0110FFFF) {\r\n+        return keysym - 0x01000000;\r\n+    }\r\n \r\n     /* search main table */\r\n     return bin_search(keysymtab, ARRAY_SIZE(keysymtab) - 1, keysym);\r\n```\r\n\r\n> As a side note, I currently have an implementation that translate XML entity names to Unicode code points in C. I don't know if there is a \"demand\" for it but be able to treat them on libxkbcommon would be a plus for me.\r\n\r\nXML entities are out of scope libxkbcommon. You should still publish it though, it might be useful for others."}}
{"actor":{"display_login":"bluetech"}}