Anyone know a quick way to convert an emoji text string into space separated unicode values?
-
-
Replying to @alvaroefe
This seems to do it https://r12a.github.io/app-conversion/
1 reply 0 retweets 2 likes -
-
Replying to @alvaroefe @_justinpenner
You can do it by codepoint with a little vanilla JS: Array.from('鍏țʗ𒑙



').map(z=>z.codePointAt().toString(16).padStart(4,'0').toUpperCase())
934F,021B,0297,12459,1F6C2,1F3F4,200D,2620,FE0F,1F1FF,1F1FC,0031,FE0F,20E3
Will split ZWJs/skins/flags/etc though.1 reply 0 retweets 0 likes -
To properly handle multi-codepoint emoji you need a list (library or whatnot) like https://github.com/mathiasbynens/emoji-regex … Though emoji property escapes should be coming soon (? cc
@mathias), which will make it possible to extract multi-codepoint emoji via regex https://mathiasbynens.be/notes/es-unicode-property-escapes …pic.twitter.com/h5i6mSd6sj
1 reply 0 retweets 1 like -
Explainer: https://mathiasbynens.be/notes/es-regexp-proposals#sequence-property-escapes … I wouldn't say it's coming "soon", unfortunately. The proposal has been stuck (at the TC39 level) for a long time because of the syntax discussion. Should this use \p{...} or something else like \m{...}? https://www.unicode.org/reports/tr18/proposed.html#Notation_for_Properties_of_Strings …
1 reply 0 retweets 0 likes
Slide deck where I make the case for unified syntax by re-using \p{...}:https://docs.google.com/presentation/d/1kQ3nlq238pMPY35oIauZWO2YUrH7NGHjNerTlYBY-cM/edit …
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.