Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

An emoji is a code point, not a picture: why the same 🍔 looks different on every device

If you have ever built a search box for a searchable list of food emoji, you have run into the same surprise: the thing you store is not an image. It is a number, and every platform decides for itself what to draw for it

If you have ever built a search box for a searchable list of food emoji, you have run into the same surprise: the thing you store is not an image. It is a number, and every platform decides for itself what to draw for it.

What actually gets stored

An emoji is a Unicode code point, for example U+1F354 for "hamburger". Unicode assigns that number an official name and a short description. It does not ship artwork. Apple, Google, Samsung and Microsoft each draw their own glyphs and bundle them into their own fonts.

So when a message goes from one phone to another, the code point arrives intact and the picture is replaced by the receiver's version. Nothing is lost in transit. There is simply no single canonical burger.

"🍔".codePointAt(0).toString(16); // "1f354"

Why food emoji show the gap best

Food emoji are tiny illustrations with plenty of detail: layers, garnish, colors. Vendor differences are easy to see there, and vendors have even redrawn some icons after public debates about the details. If a dish looks odd on your screen, check its name instead. The name is stable even when the picture is not.

Searching emoji properly

A useful emoji search does not match only the name. Unicode CLDR provides a list of keywords for every emoji, and a decent implementation combines both:

  1. Lowercase the query and split it into words.
  2. Match against the name and the CLDR keywords.
  3. Rank exact whole-word matches above partial ones.

Search for "cake" and you should get 🎂 🍰 🧁. Search for "coffee" and you should get ☕.

Empty results are usually a data problem, not a bug: a dish with no emoji of its own cannot be found by its own name. A broader word such as "fruit" or "drink" works as a fallback.

Practical rules

  • Treat an emoji as a name plus a code point, and test how it renders on at least one device that is not yours.
  • Very new code points show up as an empty box on older systems, so keep a plain-text word next to anything important.
  • When copying emoji into a template, a menu or a shared list, check the result on a second platform before sending it to everyone.

Emoji behave like a shared vocabulary, not a shared set of pictures. Each platform just draws the words in its own handwriting.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.