emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emojis and other multi-character glyphs


From: Evgeny Zajcev
Subject: Re: emojis and other multi-character glyphs
Date: Sun, 26 Dec 2021 14:09:01 +0300



вс, 26 дек. 2021 г. в 13:58, Eli Zaretskii <eliz@gnu.org>:
> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> Date: Sun, 26 Dec 2021 13:56:12 +0300
> Cc: emacs-devel <emacs-devel@gnu.org>
>
>  > In my case, I use a service that has
>  > limitation on number chars it can act on and emojis are counted as
>  > single char.
>
>  But that is incorrect: most Emoji sequences occupy two columns on display.
>
> No, no, not string-width, string length in number of glyphs, as Swift counts them: "👨‍👩‍👧‍👦".length == 1

Why and where is this important?

I think in any WYSIWYG env it is essential that you get length in glyphs that are actually displayed instead number or bytes or multibyte chars used by internal representation.

30 years ago we had only single byte chars and length was a number of bytes in string.  Then we had multibyte chars and length of such string become a number of multibyte chars.  Now we have emojis represented by multiple multibyte chars and length should be adopted as well.

--
lg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]