Emojis count as 2 characters in the status
Emojis are counted as 2 characters, thus reducing the status limit from 256 (?) to half, which is very weird, since characters like "⬛" are displayed as an emoji, but counted as only 1 character.
This is probably because JavaScript uses UTF-16, and an emoji's character code is larger than 16 bits, thus being split to 2 characters, as seen here:
-
I think this may depend on the emojis. For example, some emojis might need more characters.
Also, it is not the space required, those emojis are defined to have multiple characters, no matter if it is UTF-8, UTF-16 or UTF-32.
0 -
Are you sure? I got these results with plain browser JavaScript and https://marc.durdin.net/2012/04/a-more-utf-32-aware-javascript-string-library/
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer