Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent HTML Entity Conversion to Emoji

I've coded an HTML email and use "▶" to code a right-pointing triangle in place of an image in a call-to-action. This renders as anticipated except in iOS devices where this html entity is converted to its emoji counterpart. I also tried using the hex version instead of the decimal one with no success.

I've found posts where the solution utilizes php, but as this is an HTML email I can't use PHP.

Any way to prevent iOS from converting the HTML Entity into its emoji counterpart?

Here's the html entity I'm using: http://www.fileformat.info/info/unicode/char/25B6/index.htm

like image 852
josh1978 Avatar asked Jul 15 '14 01:07

josh1978


People also ask

How do I turn off Emojis in HTML?

So, if you need to disable emoji in your text, convert the symbol to UTF-8 or UTF-16 sequence ( symbol. codePointAt(0). toString(16) ), than add &#xFE0E to it.

How do you use Unicode Emojis in HTML?

Emojis can be inserted in HTML documents by specifying charset to UTF-8 that will be used while displaying the web pages in the browser. This character encoding information is specified by using <meta> tag in the head section. After declaration of charset, emojis can be added in HTML by using <p> and <span> tags.

What is HTML Emoji?

Emojis look like images, or icons, but they are not. They are letters (characters) from the UTF-8 (Unicode) character set. UTF-8 covers almost all of the characters and symbols in the world.


1 Answers

&#x25B6;&#xFE0E;

U+FE0F and U+FE0E are ‘variation selectors’, signalling that, respectively, an emoji-like (coloured/animated) or text-like rendering is preferred, if available. If neither is used, the renderer can choose at will. Unfortunately iOS in certain scenarios defaults to the emoji variant and has to be manually put right.

(Hex vs decimal character reference is immaterial. You can include the raw characters too, you don't necessarily have to encode them as character or entity references, but as raw characters the existance of the variant selector would be hard to see in an editor.)

like image 100
bobince Avatar answered Sep 27 '22 18:09

bobince