如何在HTML中显示表情符号字符 [英] How to display emoji char in HTML
问题描述
我将品尝美味的食物表情符号的脸保存到数据库中,并在显示uD83D \ uDE0B的php json_encode中阅读。但通常我们使用一个< img />
替换它的标签。
然而,通常我只是发现这种格式'\ uE056'而不是uD83D \ uDE0B,用pic E056.png替换。
I saved the face "savouring delicious food emoji" to database, and read it in php json_encode which show "uD83D\uDE0B"。 but usually we use one <img />
label to replace it .
however,usually I just find this format '\uE056' not "uD83D\uDE0B",to replace with pic E056.png .
我不喜欢不知道怎么把照片记录到'uD83D \ uDE0B'。有人知道吗?
I don't know how to get the pic accroding to 'uD83D\uDE0B'.someone know ?
uD83D \ uDE0B和\ uE056之间的关系是什么,它们都代表表情符号品尝美味的食物?
What the relation between 'uD83D\uDE0B' and '\uE056', they both represent emoji "savouring delicious food"?
推荐答案
Unicode字符U + 1F60B FACE SAVORING DELICIOUS FOOD是一个所谓的Plane 1字符,这意味着它的UTF-16编码形式由两个16-组成位代码单元,即0xD83D 0xDE0B。通常,Plane 1字符会导致相当大的问题,因为很多程序都没有准备好处理它们,而且很少有字体包含它们。
The Unicode character U+1F60B FACE SAVOURING DELICIOUS FOOD is a so-called Plane 1 character, which means that its UTF-16 encoded form consists of two 16-bit code units, namely 0xD83D 0xDE0B. Generally, Plane 1 characters cause considerable problems because many programs are not prepared to deal with them, and few fonts contain them.
根据 http://www.fileformat.info/info/unicode/char/1f60b/fontsupport.htm 这个特殊字符只存在于DejaVu字体和Symbola中,但我使用的DejaVu版本不包含它。
According to http://www.fileformat.info/info/unicode/char/1f60b/fontsupport.htm this particular character only exists in DejaVu fonts and in Symbola, but the versions of DejaVu I’m using don’t contain it.
您可以使用字符参考&而不是处理编码问题(这不是那么困难,但需要额外的信息)。 HTML中的#x1f608;
。但这并不能解决字体问题。我不了解iPhone字体,但一般来说,在网页浏览中,具有任何能够渲染角色的字体的计算机的可能性可能不到1%。所以你可能需要使用可下载的字体。使用图像显然更简单,更可靠。
Instead of dealing with the problems of encodings (which are not that difficult, but require extra information), you can use the character reference 😈
in HTML. But this does not solve the font problem. I don’t know about iPhone fonts, but in general in web browsing, the odds of a computer having any font capable of rendering the character are probably less than 1%. So you may need to use downloadable fonts. Using an image is obviously much simpler and mostly more reliable.
U + E056是一个私人使用代码点,这意味着任何人都可以与他的兄弟达成协议或与他自己,不问别人的想法。字体设计师可以为其指定任何字形。
U+E056 is a Private Use codepoint, which means that anybody can make an agreement about its meaning with his brother or with himself, without asking anyone else’s mind. A font designer may assign any glyph to it.
这篇关于如何在HTML中显示表情符号字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!