You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some emojis (e.g. 🏴 :flag-scotland: ) are counted as multiple characters (7 for that), which should be 1.
(omg GitHub paints them all with black ink :-( )
The stringz library does not seem to support Emoji 5.0 (2017). Perhaps we should use another one for character counting to support the latest Unicode specification.
AFAIK, grapheme-splitter will do that properly.
Expected behaviour
All emojis are counted as 1 character.
Actual behaviour
Some flag emoji are counted as 2 or more characters.
Steps to reproduce the problem
Input :flag-england: , :flag-scotland: , or :flag-wales: .
Specifications
Mastodon: 3.0.1
Browser: Firefox 70.0.1 (Windows)
The text was updated successfully, but these errors were encountered:
Emojis are, in fact, several characters, and they are counted the same way on Twitter et al. A lot of emojis are combinations of emojis that happen to be displayed as a single image, but also, some browsers might not display emojis at all, or display them as several glyphs.
The bottom line is, while it might seem counter-intuitive, the character count is correct and should stay this way.
Yah, I understand that emoji are constructed from several codepoints. The problem is, some emoji are counted by codepoints, but others are by grapheme clusters. I'm insisting on the inconsistency.
👨👨👧👦 consists of 7 codepoints, 1 grapheme cluster (so counted as 1)
:flag-scotland: also consists of 7 codepoints, 1 grapheme cluster (but counted as 7)
By the way, the lengths of posts are always counted by grapheme cluster in backend.
Just replacing stringz with grapheme-splitter does not work?
Some emojis (e.g. 🏴 :flag-scotland: ) are counted as multiple characters (7 for that), which should be 1.
(omg GitHub paints them all with black ink :-( )
The
stringz
library does not seem to support Emoji 5.0 (2017). Perhaps we should use another one for character counting to support the latest Unicode specification.AFAIK,
grapheme-splitter
will do that properly.Expected behaviour
All emojis are counted as 1 character.
Actual behaviour
Some flag emoji are counted as 2 or more characters.
Steps to reproduce the problem
Input
:flag-england:
,:flag-scotland:
, or:flag-wales:
.Specifications
Mastodon: 3.0.1
Browser: Firefox 70.0.1 (Windows)
The text was updated successfully, but these errors were encountered: