GNOME Bugzilla – Bug 621367
In keyboard display, characters for U+1xxxx appear as 'U1xxxx' (not as characters)
Last modified: 2010-06-17 12:43:59 UTC
Created attachment 163466 [details] Sample keyboard layout that uses characters from Plane1. Instead of showing characters, the 'U1xxxx' notation is shown on keyboard. If a keyboard layout has characters from Plane 1, those characters are not shown in the keyboard display window. Instead, the verbatim strings U1xxxx are shown. Tested with Ubuntu 10.04. References: http://ubuntuforums.org/showpost.php?p=9429666&postcount=35
What layout is that?
(In reply to comment #1) > What layout is that? It's https://bugs.freedesktop.org/show_bug.cgi?id=28514
That's the code: uc = gdk_keyval_to_unicode (keyval); if (uc != 0 && g_unichar_isgraph (uc)) { buf[g_unichar_to_utf8 (uc, buf)] = '\0'; pango_layout_set_text (layout, buf, -1); } else { gchar *name = gdk_keyval_name (keyval); if (name) pango_layout_set_text (layout, name, -1); else pango_layout_set_text (layout, "", -1); } In that particular case, g_unichar_to_utf8 is used - it cannot convert those unicode chars to proper utf8. Should this bug be moved to glib?
I had a look in the glib source code. I think the problem is with 'g_unichar_isgraph()', which does not recognise this new script. Other scripts in Plane 1 work OK, Looking deeper, the real problem appears to be that glib does not support yet Unicode 5.2 (supports up to Unicode 5.1). (See gitlog for glib/gunichartables.h) So, what we need is a new bug report for glib to update to Unicode 5.2. #include <glib.h> #include <stdio.h> int main(void) { char buf[16]; int len; long int uc = 0x10B7B; // long int uc = 0x10000; len = g_unichar_to_utf8(uc, buf); buf[len] = '\0'; if (!g_unichar_isgraph(uc)) printf("%s is not 'graph'\n", buf); printf(buf); return 0; }
*** This bug has been marked as a duplicate of bug 621882 ***