Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#46404 assigned defect (bug)

Emoji detection not working on Android 8.1/Chrome 72

Reported by: superpoincare's profile superpoincare Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.1
Component: Emoji Keywords: needs-patch
Focuses: Cc:


On my phone with Android 8.1, emoji detection script doesn't seem to work.

I have created this site based on for demo:

Here's how it displays.

The two emoji are: Man Facepalming: Light Skin Tone and Woman: Medium-Light Skin Tone, Red Hair

The first emoji displayed is native, implying that the test thinks that the browser supports Unicode 11.

Attachments (2)

46404.diff (1.3 KB) - added by pento 5 years ago.
46404.2.diff (2.2 KB) - added by pento 5 years ago.

Download all attachments as: .zip

Change History (31)

#1 @superpoincare
5 years ago

  • Component changed from General to Emoji
  • Version set to 5.1

#2 @pento
5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.2

Thanks for the bug report, @superpoincare!

I've been able to reproduce the same behaviour under Android 7.1.1. The problem is that emoji-loader.js is using U+200B (zero width space) in the test, instead of U+200D (zero width joiner).

Everywhere that browserSupportsEmoji() uses character 8203 needs to be changed to character 8205.

#3 @pento
5 years ago

Actually, 8203 is supposed to be in the intentionally incorrect render, as it forces browsers to render the individual emoji that make up the compound emoji.

8205 should be in the correct render.

#4 @superpoincare
5 years ago

Check here with which has 8205 instead of 8203 and the test seems to be working.

Edit: not working on Firefox Nightly on Windows 8.1 though.

Last edited 5 years ago by superpoincare (previous) (diff)

5 years ago

#5 @pento
5 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

@superpoincare: Could you try out 46404.diff, and see if that works correctly?

At the very least, it correctly disables twemoji on modern browser/OS combinations that do support emoji 11.

#6 @superpoincare
5 years ago

Hi @pento

Doesn't seem to work.


Screenshot for Chrome 73 on Android 8.1.0

Firefox Nightly on Windows 8.1

Works on Chrome on Windows, though.

#7 @superpoincare
5 years ago

Also Emojipedia has announced the release of TWemoji 12

So maybe the problem can be resolved with a new ticket for update?

#8 @superpoincare
5 years ago

I have created a new ticket for Emoji 12: #46805

5 years ago

#9 @pento
5 years ago

In 46404.2.diff:

  • Switch to using UTF-16 hex numbers for the test, rather than having to manually convert them to decimal.
  • Use a new emoji from Emoji 12: men holding hands with different skin tones.
  • Document criteria for test emoji for future updates.

I've tested that this functions correctly on:

  • Android 2.2, 4, 6, 7, 8 + Chrome
  • Windows XP + IE6
  • Windows 8.1 + Chrome, Firefox
  • iOS 6, 12 + Safari

It does not function on:

  • iOS 3 (emoji aren't replaced)
  • iOS 4/5 (emoji are replaced, but images are squashed)

#10 @pento
5 years ago

  • Owner set to pento
  • Resolution set to fixed
  • Status changed from new to closed

In 45134:

Emoji: Update Twemoji to version 12.0.0.

Props pento, superpoincare.
Fixes #46404, #46805.

#11 @superpoincare
5 years ago

Hi @pento

The file wp-emoji-loader.min.js doesn't seem to be the correct minified version of wp-emoji-loader.js

It doesn't have the UTF-16 numbers like 0xD83C

#12 @superpoincare
5 years ago

Also, doesn't seem to work in Firefox in Windows 8.1

#13 @pento
5 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks for testing, @superpoincare! I'm not sure why it's suddenly not working in Windows 8.1 + Firefox. I'm able to reproduce the same result as you.

wp-emoji-loader.min.js is being generated correctly: the minification process converts the hex numbers to decimal when there's a chance it'll use fewer characters.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.

5 years ago

#15 @superpoincare
5 years ago

There's an update which fixes missing hair components which could be important:

#16 @pento
5 years ago

Moving this to 5.3, as it requires further investigation.

#17 @superpoincare
5 years ago


But this will be released in a buggy state.

But since no browser will pass the test for now (as nobody supports Emoji 12), you could remove the tests and add

settings.supports.everything and settings.supports.everthingExceptFlag to false in wp-emoji-loader.js

for now till a solution is found.

Last edited 5 years ago by superpoincare (previous) (diff)

#18 @pento
5 years ago

The test is working correct elsewhere (eg, I just check Chrome on MacOS, it correctly identifies that Emoji 12 isn't supported).

I'm fine with a fix landing in WP 5.2.1, if it can be fixed quicker, but with WP 5.2 RC1 due out today/tomorrow, it's unlikely that a fix would make it into WP 5.2.

#19 @pento
5 years ago

  • Milestone changed from 5.2 to 5.3

#20 @pento
5 years ago

#43354 was marked as a duplicate.

#21 @davidbaumwald
5 years ago

  • Milestone changed from 5.3 to Future Release

This ticket hasn't seen any movement this cycle. With 5.3 RC1 approaching, this is being moved to Future Release. If a committer feels strongly about this one being in 5.3 and has the time to see it through, it can be moved back up.

#22 @superpoincare
4 years ago


I noticed something today. The transgender flag emoji isn't displaying in my Chrome/Windows 10, version 1909.


Although it looks different from this ticket too, as the file wp-emoji-release.min.js is loaded but might be related, so reporting here.

#23 @quicoto
4 years ago

Not sure if related but on my site running WP 5.3.2 I can see the following:

1) Firefox 71 on MacOS: emojis correctly replaced to images
2) Chrome 79 on MacOS: emojis correctly replaced to images
3) Chrome 79 on Windows: no replacement.
4) IE11 on Windows: emojis correctly replaced to images
5) Chrome 79 on Android 10: no replacement.
6) Firefox 68 on Android 10: no replacement.

Any idea why wouldn't it work for Chrome Windows?


My own site

Last edited 4 years ago by quicoto (previous) (diff)

#24 @pento
4 years ago

  • Owner pento deleted
  • Status changed from reopened to assigned

#25 @quicoto
4 years ago

Would anyone know a way to temporary skip the detection and apply the Twemoji to all devices?

While we don't have a patch, we could fix it in our functions.php file.

#26 @superpoincare
4 years ago


You can try this:


remove_action( 'wp_head', 'print_emoji_detection_script', 7 );

add_action( 'wp_head', function() {
        echo preg_replace( '/!function(.+?)window._wpemojiSettings\);/', '!function(e,t,a){function n(e){var a=t.createElement("script");a.src=e,a.defer=a.type="text/javascript",t.getElementsByTagName("head")[0].appendChild(a)}var o,d;a.supports={everything:!1,everythingExceptFlag:!1},a.DOMReady=!1,a.readyCallback=function(){a.DOMReady=!0},d=function(){a.readyCallback()},t.addEventListener?(t.addEventListener("DOMContentLoaded",d,!1),e.addEventListener("load",d,!1)):(e.attachEvent("onload",d),t.attachEvent("onreadystatechange",function(){"complete"===t.readyState&&a.readyCallback()})),(o=a.source||{}).concatemoji?n(o.concatemoji):o.wpemoji&&o.twemoji&&(n(o.twemoji),n(o.wpemoji))}(window,document,window._wpemojiSettings);', ob_get_clean() );
}, 7 );

#27 @quicoto
4 years ago

@superpoincare it works! Thank you!

#28 @superpoincare
4 years ago

Should add that it might not work if script debug is set to true.

Note: See TracTickets for help on using tickets.