https://nolanlawson.com/2022/04/08/the-struggle-of-using-native-emoji-on-the-web/
Read the Tea Leaves Software and other dark arts, by Nolan Lawson
[Search this Blog ] Search
* Home
* Apps
* Code
* Talks
* About
<< Five years of quitting Twitter
8 Apr
The struggle of using native emoji on the web
Posted April 8, 2022 by Nolan Lawson in Web. 9 Comments
Emoji are a standard overseen by the Unicode Consortium. The web is a
standard governed by bodies such as the W3C, WHATWG, and TC39. Both
emoji and the web are ubiquitous.
So you might be forgiven for thinking that, in 2022, it's possible to
plop an emoji on a web page and have it "just work":
If you see a lotus flower above, then congratulations! You're on a
browser or operating system that supports Emoji 14.0, released in
September 2021. If not, you might see something that looks like the
scoreboard on an old 80's arcade game:
Black square with monospace text inside of hexademical encoding
Another apt description would be "robot barf."
Let's try another one. What does this emoji look like to you?
If you see a face with spiral eyes, then wonderful! Your browser can
render Emoji 13.1, released in September 2020. If not, you might see
a puzzling combination of face with crossed-out eyes and a shooting
("dizzy") star:
It's a fun bit of cartoon iconography to know that this combination
means "dizzy face," but for most folks, it doesn't really evoke the
same meaning. It's not much better than the robot barf.
Emoji and browser support
If you're like me, you're a minimalist when it comes to web
development. If I don't have to rebuild something from scratch, then
I'll avoid doing so. I try to "use the platform" as much as possible
and lean on existing web standards and browser capabilities.
When it comes to emoji, there are a lot of potential upsides to using
the platform. You don't need to bring your own heavy emoji font, or
use a spritesheet, or do any manual DOM processing to replace text
with
s. But sadly, if you try to avoid these heavy-handed
techniques and just, you know, use emoji on the web, you'll quickly
run into the kinds of problems I describe above.
The first major problem is that, although emoji are released by the
Unicode Consortium at a yearly cadence, OSes don't always update in a
timely manner to add the latest-and-greatest characters. And the
browser, in most cases, is beholden to the OS to render whatever
emoji fonts are provided by the underlying system (e.g. Apple Color
Emoji on iOS, Microsoft Segoe Color Emoji on Windows, etc.).
In the case of major releases (such as Emoji 14.0), a missing
character means the "robot barf" shown above. In the case of minor
releases (such as Emoji 13.1), it can mean that the emoji renders as
a bizarre "double" emoji - some of my favorites include "man with
floating wig of red hair" () for "man with red hair" () and
"bear with snowflake" ([?]) for "polar bear" ([?]).
If I'm trying to convince you that native emoji are worth investing
in for your website, I've probably lost half my audience at this
point. Most chat and social media app developers would prefer to have
a consistent experience across all browsers and devices - not a
broken experience for some users. And even if the latest emoji were
perfectly supported across devices, these developers may still prefer
a uniform look-and-feel, which is why vendors like Twitter, Facebook,
and WhatsApp actually design their own emoji fonts.
Detecting broken emoji
Let's say, though, that you're comfortable with emoji looking
different on different platforms. After all - maybe Apple users would
prefer to see Apple emoji, and Windows users would prefer to see
Windows emoji. And in any case, you'd rather not reinvent what the OS
already provides. What do you have to do in this case?
Well, first you need a way to detect broken emoji. This is actually
much harder than it sounds, and basically boils down to rendering the
emoji to a