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 .
我将“美味的食物表情符号”保存在数据库中,并在php json_encode中读取,显示“uD83D\uDE0B”,但通常我们使用一个标签来替换它。然而,通常我只会发现这种格式“uE056”而不是“uD83D\uDE0B”,用pic E056替换。png。
I don't know how to get the pic accroding to 'uD83D\uDE0B'.someone know ?
我不知道该怎么把这张照片拍成“uD83D\uDE0B”。有人知道吗?
What the relation between 'uD83D\uDE0B' and '\uE056', they both represent emoji "savouring delicious food"?
“uD83D \ uDE0B”关系和“\ uE056”,他们都代表emoji“品尝美味的食物”?
3 个解决方案
#1
9
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.
Unicode字符U+1F60B面对美味的食物是所谓的平面1字符,这意味着它的UTF-16编码形式由两个16位编码单元组成,即0xD83D 0xDE0B。一般来说,由于许多程序没有准备好处理它们,所以平面1字符会造成相当大的问题,而且很少有字体包含它们。
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.
根据http://www.fileformat.info/info/info/unicode/char/1f60b/fontsupport.htm,这个特定的字符只存在于DejaVu字体和Symbola中,但是我使用的DejaVu的版本不包含它。
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.
您可以使用字符引用????,而不是处理编码的问题(这并不困难,但需要额外的信息)。在HTML中。但这并不能解决字体问题。我不知道iPhone的字体,但总的来说,在网页浏览中,电脑有任何能够渲染字符的字体的几率可能不到1%。所以你可能需要使用可下载的字体。使用图像显然要简单得多,而且更可靠。
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.
U+E056是一个私人使用的代码点,这意味着任何人都可以与他的兄弟或他自己达成协议,而不会询问其他人的想法。字体设计器可以为它分配任何字形。
#2
3
IMPORTANT: As of this posting, the only browser that doesn't automatically support emojis is chrome.
重要:在这个帖子中,唯一不支持表情符号的浏览器是chrome。
FOR CHROME: Depending on what server side language you are using, you should be able to find a library that converts emojis for you. I recently needed to solve this issue with php and used this library:
对于CHROME:根据您使用的服务器端语言,您应该能够找到一个可以为您转换表情符号的库。我最近需要用php解决这个问题,并使用了这个库:
https://github.com/iamcal/php-emoji
https://github.com/iamcal/php-emoji
The creator essentially created a sprite and adjusts the css according to the unicode of the emoji. It isnt pretty, but luckily he/she did all the grunt work for you. If you're using a different language you should be able to find something similar.
创建者本质上创建了一个sprite并根据表情符号的unicode调整css。这不是很漂亮,但幸运的是他/她为你做了所有的工作。如果你使用的是一种不同的语言,你应该能够找到类似的东西。
#3
0
how do I put those little boxes into a php file?
如何将这些小框放入php文件中?
Same way as any other Unicode character. Just paste them and make sure you're saving the PHP file and serving the PHP page as UTF-8.
和其他Unicode字符一样。只需粘贴它们并确保保存PHP文件并将PHP页面作为UTF-8服务。
When I put it into a php file, it turns into question marks and what not
当我把它放到php文件中时,它会变成问号,而不是。
Then you have an encoding problem. Work it out with Unicode characters you can actually see properly first, for example ąαд™日本, before worrying about the emoji.
然后是编码问题。工作与Unicode字符你首先可以看到正确,例如ąαд™日本,担心emoji之前。
Your PHP file should be saved as UTF-8; the page it produces should be served as Content-Type: text/html;charset:UTF-8
(or with similar meta tag); the MySQL database should be using a UTF-8 collation to store data and PHP should be talking to MySQL using UTF-8.
您的PHP文件应该被保存为UTF-8;它所生成的页面应该作为内容类型:文本/html;字符集:UTF-8(或使用类似的元标记);MySQL数据库应该使用UTF-8排序来存储数据,PHP应该使用UTF-8与MySQL对话。
However. Even handling everything correctly like this, PCs will still not show the emoji. That's because:
然而。即使是这样处理所有的事情,个人电脑仍然不能显示表情符号。这是因为:
they don't have fonts that include shapes for those characters, and
它们没有包含这些字符形状的字体。
emoji are still completely unstandardised. Those characters you posted are in the Unicode Private Use Area, which means they don't have any official meaning at all.
表情符号仍然是完全不标准化的。你张贴的那些字符是在Unicode的私人使用区域,这意味着它们没有任何官方意义。
Each network in Japan uses different character codes for their emoji, mapped to different areas in the PUA. So even on another mobile phone, it probably won't display the correct character, unless you spend ages manually converting emoji codes for different networks. I'm guessing the ones you posted above are from SoftBank (iPhone?).
日本的每个网络都使用不同的字符编码,将表情符号映射到PUA的不同区域。因此,即使是在另一个手机上,它也可能不会显示出正确的字符,除非你花了很多时间来手动转换不同网络的表情符号。我猜你上面发布的那些是来自软银(iPhone?)
There is an ongoing proposal led by Google and Apple to collate the different networks' emoji and give them a proper standardised place in Unicode. Until then, getting emoji to display consistently across networks is an exercise in unhappiness. See the character overview from the standardisation work to see how much converting you would have to do.
谷歌和苹果(Apple)正在进行一项提议,以整理不同网络的表情符号,并在统一码中给他们一个合适的标准化位置。在此之前,让表情符号在网络上一致显示是一种不快乐的行为。从标准化工作中查看字符概述,看看您需要做多少转换。
God, I hate emoji. All that pain for such a load of useless twee rubbish.
上帝,我讨厌emoji。对这样一堆无用的粗花呢垃圾所带来的痛苦。
#1
9
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.
Unicode字符U+1F60B面对美味的食物是所谓的平面1字符,这意味着它的UTF-16编码形式由两个16位编码单元组成,即0xD83D 0xDE0B。一般来说,由于许多程序没有准备好处理它们,所以平面1字符会造成相当大的问题,而且很少有字体包含它们。
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.
根据http://www.fileformat.info/info/info/unicode/char/1f60b/fontsupport.htm,这个特定的字符只存在于DejaVu字体和Symbola中,但是我使用的DejaVu的版本不包含它。
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.
您可以使用字符引用????,而不是处理编码的问题(这并不困难,但需要额外的信息)。在HTML中。但这并不能解决字体问题。我不知道iPhone的字体,但总的来说,在网页浏览中,电脑有任何能够渲染字符的字体的几率可能不到1%。所以你可能需要使用可下载的字体。使用图像显然要简单得多,而且更可靠。
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.
U+E056是一个私人使用的代码点,这意味着任何人都可以与他的兄弟或他自己达成协议,而不会询问其他人的想法。字体设计器可以为它分配任何字形。
#2
3
IMPORTANT: As of this posting, the only browser that doesn't automatically support emojis is chrome.
重要:在这个帖子中,唯一不支持表情符号的浏览器是chrome。
FOR CHROME: Depending on what server side language you are using, you should be able to find a library that converts emojis for you. I recently needed to solve this issue with php and used this library:
对于CHROME:根据您使用的服务器端语言,您应该能够找到一个可以为您转换表情符号的库。我最近需要用php解决这个问题,并使用了这个库:
https://github.com/iamcal/php-emoji
https://github.com/iamcal/php-emoji
The creator essentially created a sprite and adjusts the css according to the unicode of the emoji. It isnt pretty, but luckily he/she did all the grunt work for you. If you're using a different language you should be able to find something similar.
创建者本质上创建了一个sprite并根据表情符号的unicode调整css。这不是很漂亮,但幸运的是他/她为你做了所有的工作。如果你使用的是一种不同的语言,你应该能够找到类似的东西。
#3
0
how do I put those little boxes into a php file?
如何将这些小框放入php文件中?
Same way as any other Unicode character. Just paste them and make sure you're saving the PHP file and serving the PHP page as UTF-8.
和其他Unicode字符一样。只需粘贴它们并确保保存PHP文件并将PHP页面作为UTF-8服务。
When I put it into a php file, it turns into question marks and what not
当我把它放到php文件中时,它会变成问号,而不是。
Then you have an encoding problem. Work it out with Unicode characters you can actually see properly first, for example ąαд™日本, before worrying about the emoji.
然后是编码问题。工作与Unicode字符你首先可以看到正确,例如ąαд™日本,担心emoji之前。
Your PHP file should be saved as UTF-8; the page it produces should be served as Content-Type: text/html;charset:UTF-8
(or with similar meta tag); the MySQL database should be using a UTF-8 collation to store data and PHP should be talking to MySQL using UTF-8.
您的PHP文件应该被保存为UTF-8;它所生成的页面应该作为内容类型:文本/html;字符集:UTF-8(或使用类似的元标记);MySQL数据库应该使用UTF-8排序来存储数据,PHP应该使用UTF-8与MySQL对话。
However. Even handling everything correctly like this, PCs will still not show the emoji. That's because:
然而。即使是这样处理所有的事情,个人电脑仍然不能显示表情符号。这是因为:
they don't have fonts that include shapes for those characters, and
它们没有包含这些字符形状的字体。
emoji are still completely unstandardised. Those characters you posted are in the Unicode Private Use Area, which means they don't have any official meaning at all.
表情符号仍然是完全不标准化的。你张贴的那些字符是在Unicode的私人使用区域,这意味着它们没有任何官方意义。
Each network in Japan uses different character codes for their emoji, mapped to different areas in the PUA. So even on another mobile phone, it probably won't display the correct character, unless you spend ages manually converting emoji codes for different networks. I'm guessing the ones you posted above are from SoftBank (iPhone?).
日本的每个网络都使用不同的字符编码,将表情符号映射到PUA的不同区域。因此,即使是在另一个手机上,它也可能不会显示出正确的字符,除非你花了很多时间来手动转换不同网络的表情符号。我猜你上面发布的那些是来自软银(iPhone?)
There is an ongoing proposal led by Google and Apple to collate the different networks' emoji and give them a proper standardised place in Unicode. Until then, getting emoji to display consistently across networks is an exercise in unhappiness. See the character overview from the standardisation work to see how much converting you would have to do.
谷歌和苹果(Apple)正在进行一项提议,以整理不同网络的表情符号,并在统一码中给他们一个合适的标准化位置。在此之前,让表情符号在网络上一致显示是一种不快乐的行为。从标准化工作中查看字符概述,看看您需要做多少转换。
God, I hate emoji. All that pain for such a load of useless twee rubbish.
上帝,我讨厌emoji。对这样一堆无用的粗花呢垃圾所带来的痛苦。