Mark
Mark

Reputation: 7576

Android WebView does not render emoji U+1F642, U+1F917

If I load the Unicode emoji chart (http://unicode.org/emoji/charts/full-emoji-list.html) in an Android WebView, the emojis for U+1F642 and U+1F917 do not render properly.

mWebView = (WebView) findViewById(R.id.web_view);

// Calling all or none of the next 3 calls does NOT change the behavior
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebChromeClient(new WebChromeClient());
mWebView.setWebViewClient(new WebViewClient());

mWebView.loadUrl("http://unicode.org/emoji/charts/full-emoji-list.html");

This is especially odd since in the first column the emoji do not render but in the Google column they render fine.

See the attached image. The red box shows the two emoji. Notice in the 3rd column they are not rendered properly. In the Google column (blue box), they do render properly. EDIT: This is because the things in the blue box are images.

Any ideas why some emoji don't render properly in the Android WebView?

Emoji rendering issue

Upvotes: 1

Views: 2685

Answers (1)

Tony Ohmann
Tony Ohmann

Reputation: 51

This will depend on which version of Android's WebView you use.

Slightly smiling face was added in Unicode 7.0, which became supported in Android 5.0.

Hugging face was added in Unicode 8.0, which became supported in Android 6.0.1.

I'm assuming you must be viewing this on an older WebView version. The other columns load because they're actually images, not the Unicode characters (emoji) themselves.

Upvotes: 2

Related Questions