[Bug locale/32322] wcswidth() wrongly returns width 1 for emoji (variation selector-16)

vincent-srcware at vinc17 dot net sourceware-bugzilla@sourceware.org
Thu Dec 25 11:24:44 GMT 2025


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

--- Comment #4 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
(In reply to Johannes Altmanninger from comment #3)
> I see. Programs that output to a terminal might want to use kitty's
> text-sizing protocol to solve this issue in a backwards-compatible way:
> https://github.com/kovidgoyal/kitty/blob/
> 0fb54d32b1976d7269300cc59eef085b0bbdd1a6/docs/text-sizing-protocol.rst

"To avoid this issue, it is recommended applications detect when U+FE0E is
present and in such cases use the width part of the text sizing protocol to
control rendering."

I agree, and I think that this should also be the case for U+FE0F (so both VS15
and VS16), i.e. U+FE0E and U+FE0F should not be sent to the terminal as they
would be ambiguous. So, on the side of the C library, wcwidth and wcswidth
should return -1 (see bug 33741 for wcwidth) when such characters occur.

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


More information about the Glibc-bugs mailing list