[wp-trac] [WordPress Trac] #57301: Emoji feature detection is incorrect
WordPress Trac
noreply at wordpress.org
Fri Dec 9 22:03:55 UTC 2022
#57301: Emoji feature detection is incorrect
---------------------------+--------------------------------------
Reporter: sergiomdgomes | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Emoji | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: javascript, performance
---------------------------+--------------------------------------
Comment (by dmsnell):
Love me some text encoding fixes 🤟
> If the browser doesn't support String.fromCodePoint, assume that it
doesn't correctly support the latest emoji either.
Is this a valid assumption? Or maybe I should ask, what are we referring
to when we say "latest emoji"? For instance, are we talking about the
latest revision of the Unicode standard with whatever emoji are newly
added? There have been nine Unicode updates (each adding new Emoji) since
`fromCodePoint` was introduced (the count differs per browser) so I guess
I'm confused on what this comment is asserting.
I tried installing versions of Chrome and Firefox from before they
supported `fromCodePoint` but both attempts failed. That being said, they
are very very old (eight and ten years I think) and so I would guess for
most people this isn't going to be an issue.
The only reason I ask is because I suspect we have more support for Emoji
than we do for `fromCodePoint`, and if, for instance, we used
`"\ud83c\udd70"` as `[0xd83c, 0xdd70].map( c => String.fromCharCode(c)
).join('')` instead of `[0x1f170].map( c => String.fromCodePoint(c)
).join('')` then we'd get the same result even though we might assert it's
not there (because `fromCodePoint` isn't).
Those two strings are identical. So if there's any confusion here, it may
not matter. Still, I think it's possible that the browser and JavaScript
might be old enough that `fromCodePoint` isn't available, but when
rendering, the emoji are present as expected.
> The sequences are stored as arrays of hexadecimal numbers
You had me at arrays of numbers but lost me with "hexadecimal" numbers.
I'm guessing you mean they are strings like `"0x1F170"`? Or are they just
//numbers// which happen to be recorded as hexadecimal literals (source
code is 0x1f170 instead of the identical number, `127344` (and is
"hexadecimal" relevant here or just a tangent)?
Again, maybe not important, just thrown off by being confused on the
wording, in case it's important and I don't understand the bit that makes
it important.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57301#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list