public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nickblack at linux dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/26207] New: wcwidth() returns -1 for numerous emoji added by unicode 13.0
Date: Sun, 05 Jul 2020 17:08:05 +0000	[thread overview]
Message-ID: <bug-26207-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=26207

            Bug ID: 26207
           Summary: wcwidth() returns -1 for numerous emoji added by
                    unicode 13.0
           Product: glibc
           Version: 2.33
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: nickblack at linux dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

This is with the 2.33 candidate, commit ca3549c8. I see the same behavior on my
vendor (Debian Unstable, glibc 2.30-8) glibc.

In a proper UTF-8 locale (LANG="en_US.UTF-8"), wcwidth() returns -1 for a
number of emoji introduced by Unicode 13.0. I've prepared what I believe to be
an exhaustive list:

U+01f972
U+01f978
U+01f90c
U+01fac0
U+01fac1
U+01f9ac
U+01f9a3
U+01f9ab
U+01f9a4
U+01fab6
U+01f9ad
U+01fab2
U+01fab3
U+01fab0
U+01fab1
U+01fab4
U+01fad0
U+01fad2
U+01fad1
U+01fad3
U+01fad4
U+01fad5
U+01fad6
U+01f9cb
U+01faa8
U+01fab5
U+01f6d6
U+01f6fb
U+01f6fc
U+01fa84
U+01fa85
U+01fa86
U+01faa1
U+01faa2
U+01fa74
U+01fa96
U+01fa97
U+01fa98
U+01fa99
U+01fa83
U+01fa9a
U+01fa9b
U+01fa9d
U+01fa9c
U+01f6d7
U+01fa9e
U+01fa9f
U+01faa0
U+01faa4
U+01faa3
U+01faa5
U+01faa6
U+01faa7

while all of these values have a high 17th bit, there are numerous codepoints
with a high 17th bit for which glibc returns a correct wcwidth() value.

This was discovered while developing the "Mojibake" demo of Notcurses:
https://github.com/dankamongmen/notcurses/blob/master/src/demo/mojibake.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2020-07-05 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 17:08 nickblack at linux dot com [this message]
2020-12-21  2:45 ` [Bug libc/26207] " jscott at posteo dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26207-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).