After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621367 - In keyboard display, characters for U+1xxxx appear as 'U1xxxx' (not as characters)
In keyboard display, characters for U+1xxxx appear as 'U1xxxx' (not as charac...
Status: RESOLVED DUPLICATE of bug 621882
Product: libgnomekbd
Classification: Core
Component: Capplet
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgnomekbd maintainers
Sergey V. Udaltsov
Depends on:
Blocks:
 
 
Reported: 2010-06-12 11:42 UTC by Simos Xenitellis
Modified: 2010-06-17 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample keyboard layout that uses characters from Plane1. Instead of showing characters, the 'U1xxxx' notation is shown on keyboard. (53.73 KB, image/jpeg)
2010-06-12 11:42 UTC, Simos Xenitellis
Details

Description Simos Xenitellis 2010-06-12 11:42:17 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
Comment 1 Sergey V. Udaltsov 2010-06-15 20:28:46 UTC
What layout is that?
Comment 2 Simos Xenitellis 2010-06-16 11:33:02 UTC
(In reply to comment #1)
> What layout is that?

It's https://bugs.freedesktop.org/show_bug.cgi?id=28514
Comment 3 Sergey V. Udaltsov 2010-06-16 21:22:56 UTC
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?
Comment 4 Simos Xenitellis 2010-06-17 12:43:07 UTC
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;
}
Comment 5 Simos Xenitellis 2010-06-17 12:43:59 UTC

*** This bug has been marked as a duplicate of bug 621882 ***