2

Removing people using UTF-8 ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ

 2 years ago
source link: https://dev.to/jancizmar/removing-people-using-utf-8-3d2f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for Removing people using UTF-8 ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ
Jan Cizmar

Posted on Nov 25

Removing people using UTF-8 ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ

While I was writing my new article I found out about really cool thing I am going to share with you.

Check out this emoji containing 4 people ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ.

While I was trying to delete ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ in VSCode using backspace it
didn't disappear, but it just changed to this ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ. After hitting another backspace it changed to ๐Ÿ‘ฉโ€๐Ÿ‘ฉ then to ๐Ÿ‘ฉ and then it finally disappeared. So it goes

๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ โŒซ ๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ โŒซ ๐Ÿ‘ฉโ€๐Ÿ‘ฉ โŒซ ๐Ÿ‘ฉ โŒซ
Enter fullscreen modeExit fullscreen mode

Why this happens?

When we look on the decoded symbols, we can see that the symbols are equal to this in hex:

๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ:  0x1f469 0x200d 0x1f469 0x200d 0x1f466 0x200d 0x1f466
๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ:  0x1f469 0x200d 0x1f469 0x200d 0x1f466
๐Ÿ‘ฉโ€๐Ÿ‘ฉ:    0x1f469 0x200d 0x1f469
๐Ÿ‘ฉ:   0x1f469
Enter fullscreen modeExit fullscreen mode

While 0x200d character is a "ZERO WIDTH JOINER" which tells the renderer, that the preceding and following characters should join each other. ๐ŸŽ‰

So it is like ๐Ÿ‘ฉ + ๐Ÿ‘ฉ + ๐Ÿ‘ฆ + ๐Ÿ‘ฆ.

Cool isn't it?

Removing of single woman works as well, so this ๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ can transformed to the hex code like this: 0x1f469 0x200d 0x1f466 0x200d 0x1f466


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK