Peter Kröner on Nostr: Wait, what? ❤️ is an emoji, so it is built up from surrogate pairs, right? NOPE! ...
Wait, what?
❤️ is an emoji, so it is built up from surrogate pairs, right?
NOPE! Turns out it consists of U+2764 (plain ❤ symbol) and U+FE0F (Variation Selector 16)
This is why you should use Intl.Segmenter() and just deal with its abysmal performance 😭
#javascript #unicode #fml
Published at
2024-11-26 08:40:41 UTCEvent JSON
{
"id": "b3fbf8d716eca1a47b414053a1a1ae0191d3b926721145dd126f7b2788c843fe",
"pubkey": "7428de0b9fdbca1d85e11ba7078bd01d4b710a00f0a1a809a0b2d91fd53fc5b6",
"created_at": 1732610441,
"kind": 1,
"tags": [
[
"t",
"unicode"
],
[
"t",
"javascript"
],
[
"t",
"fml"
],
[
"proxy",
"https://mastodon.social/@sir_pepe/113548357920821852",
"web"
],
[
"proxy",
"https://mastodon.social/users/sir_pepe/statuses/113548357920821852",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/sir_pepe/statuses/113548357920821852",
"pink.momostr"
],
[
"-"
]
],
"content": "Wait, what?\n\n❤️ is an emoji, so it is built up from surrogate pairs, right?\n\nNOPE! Turns out it consists of U+2764 (plain ❤ symbol) and U+FE0F (Variation Selector 16)\n\nThis is why you should use Intl.Segmenter() and just deal with its abysmal performance 😭 \n\n#javascript #unicode #fml",
"sig": "11174da082b32320535a0765d94dd9508e7f7b148cc6f7a5cc0a4057a8a6fd487d53c826833f32a33e1bdaf2beb811642fbafd36e96f575c9fcdc0abd0f92444"
}