So my phone keyboard has two red heart emojis, one flat (
) and one shaded () (though idk how those will render here, the editor seems to be treating them as images?), and I wanted to know what the difference was between them. So I opened gmail and copied both of them into a draft which I then opened on my laptop.
Highlighted to copy.xsel gave me hard-to-read garbage which was kind of unsurprising.xsel | hexdump -C should give the UTF-8 encoding -
- but the result was ef bf bc ef bf bc, i.e. the same character twice. Turns out that’s object replacement character so that makes sense
Anyway I tried various combinations of whitespace between them or not, and copy by highlighting/xsel or ctrl-c/xsel -b. Turns out that if I highlight I only get object replacement, but if I highlight and then do ctrl-c then xsel and xsel -b both give the correct characters, which render in my terminal (but it doesn’t handle their width properly—it renders them as width 2, but only moves 1 space to the right to display the next character)
Also turns out that if I have a space between them, highlight+xsel gives the space as c2 a0 (non-breaking space) while ctrl-c+xsel gives the space as 20 (the normal space character).
Anyway. Both of them are two three-byte characters. The flat heart is e2 99 a5 / ef b8 8f (black heart suit / variation selector 16) while the shaded heart is e2 9d a4 / ef b8 8f (heavy black heart / variation selector 16).
Wikipedia has it that variation selector 16 means “render this as an emoji”. Presumably somewhere defines that these two hearts, when rendered as emojis, should look more-or-less like they do. Possibly it even gives them distinct names. But this is as far as I feel like investigating right now.
(To look up those characters, I just googled e.g. “unicode e299a5”. I know more-or-less how I’d turn that into 2665 if google didn’t help, and if I forgot I know where to look it up. Probably there’s also an online converter that would do it for me. But it wasn’t necessary.)
So my phone keyboard has two red heart emojis, one flat (
) and one shaded () (though idk how those will render here, the editor seems to be treating them as images?), and I wanted to know what the difference was between them. So I opened gmail and copied both of them into a draft which I then opened on my laptop.Highlighted to copy.
xsel
gave me hard-to-read garbage which was kind of unsurprising.xsel | hexdump -C
should give the UTF-8 encoding -- but the result was
ef bf bc ef bf bc
, i.e. the same character twice. Turns out that’s object replacement character so that makes senseAnyway I tried various combinations of whitespace between them or not, and copy by highlighting/
xsel
or ctrl-c/xsel -b
. Turns out that if I highlight I only get object replacement, but if I highlight and then do ctrl-c thenxsel
andxsel -b
both give the correct characters, which render in my terminal (but it doesn’t handle their width properly—it renders them as width 2, but only moves 1 space to the right to display the next character)Also turns out that if I have a space between them, highlight+
xsel
gives the space asc2 a0
(non-breaking space) while ctrl-c+xsel
gives the space as20
(the normal space character).Anyway. Both of them are two three-byte characters. The flat heart is
e2 99 a5 / ef b8 8f
(black heart suit / variation selector 16) while the shaded heart ise2 9d a4 / ef b8 8f
(heavy black heart / variation selector 16).Wikipedia has it that variation selector 16 means “render this as an emoji”. Presumably somewhere defines that these two hearts, when rendered as emojis, should look more-or-less like they do. Possibly it even gives them distinct names. But this is as far as I feel like investigating right now.
(To look up those characters, I just googled e.g. “unicode e299a5”. I know more-or-less how I’d turn that into 2665 if google didn’t help, and if I forgot I know where to look it up. Probably there’s also an online converter that would do it for me. But it wasn’t necessary.)