简体   繁体   English

如何在有效的html实体中转换诸如“ \\ u2764”这样的unicode实体

[英]How can I convert unicode entities like this “\u2764” in valid html entities

I am working with the twitter API and sometimes i found this characters: Today's gonna be so fun "❤" and some others like a tennis ball, a jar of beer, etc. Please see this image. 我正在使用twitter API,有时我会发现以下字符:今天的“❤”会很有趣,还有网球,一罐啤酒等其他东西。请参见此图。

How can I take those characters and properly encoding them in a mysql database? 如何获取这些字符并将其正确编码在mysql数据库中?

As usual there was something stupid :| 和往常一样,有些愚蠢:| I just added this header to the page header('Content-Type: text/html; charset=UTF-8'); 我只是将此标头添加到页面标头('Content-Type:text / html; charset = UTF-8'); and everything worked fine. 而且一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM