阻止HTML实体转换为Emoji [英] Prevent HTML Entity Conversion to Emoji

查看:297
本文介绍了阻止HTML实体转换为Emoji的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一封HTML电子邮件并使用▶在行动号召中编码右侧三角形代替图片。除了iOS设备中的这个html实体被转换为emoji对象外,这种渲染方式与预期一致。我也尝试使用十六进制版本,而不是小数未成功。



我发现解决方案利用php的帖子,但因为这是一个HTML电子邮件我不能使用PHP。

防止iOS将HTML实体转换为其emoji对象的任何方法?



这里是我使用的html实体: http:// www。 fileformat.info/info/unicode/char/25B6/index.htm

解决方案

 &放大器;#x25B6;&安培;#xFE0E; 

U + FE0F和U + FE0E是'变化选择器',分别表示表情符号 - 像(彩色/动画)或文字式渲染是首选,如果可用的话。如果两者均未使用,则渲染器可以随意选择。不幸的是,iOS在某些情况下默认为表情符号变体,并且必须手动正确放置。



(十六进制与十进制字符引用不重要,也可以包含原始字符,你不一定必须将它们编码为字符或实体引用,但作为原始字符,变体选择符的存在很难在编辑器中看到。)


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

解决方案

▶︎

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

这篇关于阻止HTML实体转换为Emoji的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆