Prevent HTML Entity Conversion to Emoji

泪湿孤枕 提交于 2019-12-03 11:33:44

问题


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


回答1:


▶︎

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.)



来源:https://stackoverflow.com/questions/24748565/prevent-html-entity-conversion-to-emoji

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!