Forum Settings
Forums

[BUG] Emojis aren't counted correctly

New
Yesterday, 12:32 PM
#1

Online
Dec 2021
4218
I don't know when I found this out, but the unicode for emojis are quite long. Some especially are horribly weird, like "πŸ‘©πŸ»‍❀️‍πŸ’‹‍πŸ‘¨πŸΎ". Literally just

πŸ‘©πŸ»‍❀️‍πŸ’‹‍πŸ‘¨πŸΎ

Is counted as at least 30 characters. I tested this by, on CD's "What are you doing right now?", replying with just that emoji. It fulfilled the 30 character requirement. I obviously replaced the entire contents of the post with a pre-written rant about how I found out how weird some emojis were seconds after the single emoji reply successfully posted.

This is probably an easy fix, just count emojis as individual characters, rather than looking at the components that make up an emoji.


Side note: Probably also don't count the characters inside

[yt]elevenchars[/yt]

...towards the character limit, that's also likely a very easy fix.

EDIT: Should also mention that with emoji specifically, there seems to be a difference between client-side and server-side counting, since the MAL app can post something like "πŸ”₯πŸ”₯πŸ”₯πŸ”₯", but the website cannot. Presumably this means that "πŸ”₯πŸ”₯πŸ”₯πŸ”₯" is read as 36 characters server-side (And the app specifically doesn't check client-side) and 16 characters client-side, and as such "πŸ‘©πŸ»‍❀️‍πŸ’‹‍πŸ‘¨πŸΎ" is read client-side as 35 characters and server-side as 82 characters! Some others below that only the app can post on all boards...

    🏴󠁧󠁒󠁳󠁣󠁴󠁿
    • 28 characters client-side
    • 63 characters server-side

    πŸ„‍♂️
    • 13 characters client-side
    • 31 characters server-side

    πŸ‘¨πŸΎ‍🦲
    • 15 characters client-side
    • 34 characters server-side

    πŸ‘©‍πŸ‘§‍πŸ‘¦
    • 18 characters client-side
    • 41 characters server-side

This is from some guesswork which led me to gathering that an emoji is read as a UTF-8 byte-length on the client-side (Including glue characters), whereas it's converted to decimal entities server-side, so πŸ„‍♂️ is 13 bytes client-side, but is decoded to "🏄‍♂️" server-side, thus becoming 31 characters if posted on the app.
Daviljoe19310 hours ago

More topics from this board

» This stack should be set to Unlisted, or written as an article

SpacemanSpiff357 - Mar 25, 2023

9 by Lucifrost »»
Yesterday, 10:38 AM

» (BUG) Can't edit details on anime/manga entries + can't log in elsewhere but can stay logged in on current session (400 Bad Request)

abystoma2 - Dec 15

10 by -DxP- »»
Yesterday, 7:02 AM

» [BUG] All Symbols Gone

ak64 - May 13

6 by SD_Sub »»
Dec 18, 7:44 PM

» Plan to Drop (watched a sneak peak)

Daichi09 - Dec 15

3 by Timcampy »»
Dec 16, 4:00 PM

» How can I appeal a permanent ban?

Danila_Naumov - Dec 15

0 by Danila_Naumov »»
Dec 15, 3:49 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login