It's a pretty obscure edge case. You could retain ZWJs when they were between two Unicode points with the Symbol or Emoji Symbol classes, but on further reflection, it would probably be more honest to just strip the ZWJs everywhere and decompose the emojis.
Suppose, for example, that you want the emoji "Man Facepalming Medium Skin Tone". There is no single Unicode code point for that. Instead, it uses five code points:
U+1F926 FACE PALM
U+1F3FD EMOJI MODIFIER FITZPATRICK TYPE-4
U+200D ZERO WIDTH JOINER
U+2642 MALE SIGN
U+FE0F VARIATION SELECTOR-16
The first two compose to make the "facepalm" with desired skin tone. The last two make "man". The zero-width joiner composes the first two and last two together, so that the whole sequence renders as a single emoji.
Does anyone remember how many years of pain were caused by different line endings -- "\n" vs. "\r" vs. "\r\n"? Unicode is 10x that, and the pain is just beginning.
Probably, since it's an omnishambles on a scale I won't pretend to understand. Eight-fingered and two-thumbed humans can't type it, but they've managed to make it a joke (see zalgo text), and it only gets more ridiculous with time (see how flags are done, or emoji skin-tone modifiers). It's only a matter of time before Metafont will be easier to read and write than the hieroglyphics we're supposed to call "text."
I know it's pretty basic stuff but it does the job. The encoder outputs both in stdout and into a file so you can copy/past it more easily (from Sublime Text for example)
Comments (96) 22 threads
Earlier commentshttps://emojipedia.org/zero-width-joiner/
EDIT: also what jedanbik said
Suppose, for example, that you want the emoji "Man Facepalming Medium Skin Tone". There is no single Unicode code point for that. Instead, it uses five code points:
The first two compose to make the "facepalm" with desired skin tone. The last two make "man". The zero-width joiner composes the first two and last two together, so that the whole sequence renders as a single emoji.Here's a list of emoji which use the ZWJ this way:
https://emojipedia.org/emoji-zwj-sequences/
I know it's pretty basic stuff but it does the job. The encoder outputs both in stdout and into a file so you can copy/past it more easily (from Sublime Text for example)
Continue this thread — 1 reply
Apply an autoload rule with these settings:
All comments shown.
Couldn't load more comments. Check your connection and try again.