Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Encode any text into one emoji (paulbutler.org)
4 points by paulgb 11 months ago | hide | past | favorite | 2 comments


This morning I got nerd-sniped by this comment[1] on the Open Heart Protocol about encoding arbitrary-length data in an emoji.

I wanted to try it out and sure enough, you can encode an arbitrary string message in one unicode character!

The approach I took is to encode the string as UTF-8, and then turn each byte into a pair of “variation selector” characters (there are conveniently 16 codepoints allocated as variation selectors, and 16x16 = 256). Variation selectors don't show up visually, but are retained when the character is copied/pasted.

Some platforms normalize the character, but others don't (Google Docs in particular does not!)

Here's the code: https://github.com/paulgb/emoji-encoder/blob/main/app/encodi...

[1] https://news.ycombinator.com/item?id=42823876


Funky! Round trip through Signal worked. But you can tell, because a regular single emoji gets "jumbo sized", these ones don't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: