Without using a library or lookup object, is it possible to get the description or name of an emoji in JavaScript?
-
-
Replying to @wesbos
The main problem is the nebulous and ever-changing definitions of emoji. This was emoji, but removed:

This is emoji only on Windows: 🖔
This only on Samsung: ☰
And segmenting them is a full time job. See @mathias's maintained regex:https://github.com/mathiasbynens/emoji-regex …1 reply 0 retweets 6 likes -
Once you've isolated them, then you have categories. Atomic:
Skin tone:
RIS pair:
Keycap:
Variant forms: ♟ ♟︎
ZWJ sequence:
etc.
Only the atomic ones have clearly defined codepoint names, but the emoji data files give descriptions:
https://unicode.org/Public/emoji/latest/ …pic.twitter.com/ArupRQuNsD
1 reply 0 retweets 4 likes -
TLDR of this is that one should use CLDR shortnames. They can be changed and updated, and are translated into many languages. https://www.unicode.org/cldr/charts/latest/annotations/romance.html … Like the rather obscure japanese expression:
1f624 FACE WITH LOOK OF TRIUMPH
has the CLDR name "face with steam from nose"pic.twitter.com/L12XuPbyeS
1 reply 0 retweets 4 likes -
Maintaining a library or package to do this is spooky/fragile, since specs can change often. Since 2014 Unicode has updated Emoji at least yearly. There was also an emergency release last year (emoji 12.1) to accommodate Apple's sudden addition of gender-neutral variants.
1 reply 0 retweets 2 likes -
The closest thing to library-free lookups would be with the ECMA2018 emoji property escapes (also thanks to
@mathias). https://mathiasbynens.be/notes/es-unicode-property-escapes … But that still will quickly fall out of date as new specs roll in, and won't help with names.pic.twitter.com/YA5INXuRYJ
1 reply 0 retweets 2 likes
Note that this still wouldn't support emoji that consist of multiple code points. For that, we'd need support for something like \p{SequenceProperty}:https://github.com/tc39/proposal-regexp-unicode-sequence-properties …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.