php存储处理Emoji表情问题,在线等待

三十多岁老男孩 2016-10-02 02:19:45
比如,在线等,请大神赐教:


...全文
345 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cwk44 2016-10-04
  • 打赏
  • 举报
回复
四个?只是mysql的显示问题,mysql无法显示不能代表数据有问题,只要php读取的是正确的就行了。 emoji是二进制编码,一般直接输出到html里是无法显示的 最简单的验证方法是用二进制去校验读出来的有没有问题 比如这样验证: if ($value === "\uXXXX\uXXXX\uXXXX")
  • 打赏
  • 举报
回复
就这样:
  • 打赏
  • 举报
回复
引用 4 楼 xuzuning 的回复:
不知道你要做什么 mysql 存储 emoji 表情符,需选用 utf8mb4 字符集
那请问在微网站里显示emoji 表情符该怎么做编码处理呢? mysql> status; -------------- mysql Ver 14.14 Distrib 5.6.31, for Linux (x86_64) using EditLine wrapper Connection id: 27640 Current database: zuwo Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.6.31 MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 29 days 9 hours 25 min 11 sec Threads: 1 Questions: 168219 Slow queries: 0 Opens: 99 Flush tables: 1 Open tables: 79 Queries per second avg: 0.066 -------------- mysql> show create table `cc_baseinfo`; +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | cc_baseinfo | CREATE TABLE `cc_baseinfo` ( `userid` int(11) NOT NULL AUTO_INCREMENT, `openid` char(100) NOT NULL, `nickname` char(50) DEFAULT NULL, `sex` enum('0','1') DEFAULT NULL, `language` char(10) DEFAULT NULL, `city` char(30) DEFAULT NULL, `province` char(30) DEFAULT NULL, `country` char(30) DEFAULT NULL, `headimgurl` char(225) DEFAULT NULL, `privilege` char(30) DEFAULT NULL, `unionid` char(100) DEFAULT NULL, `registertime` datetime DEFAULT NULL, `logintime` datetime DEFAULT NULL, `phone` char(15) DEFAULT NULL, `age` tinyint(3) unsigned DEFAULT NULL, `stature` tinyint(3) unsigned DEFAULT NULL, `profession` char(40) DEFAULT NULL, `weixinhao` char(255) DEFAULT NULL, `picureurl` char(225) DEFAULT NULL, `chuzufanwei` char(225) DEFAULT NULL, `shixin` decimal(10,2) DEFAULT NULL, `rixin` decimal(10,2) DEFAULT NULL, `chengyi` char(255) DEFAULT NULL, `dangqi` char(255) DEFAULT NULL, `tedian` char(255) DEFAULT NULL, `status` enum('0','1','2','3','4','5') DEFAULT '0', `picureurl2` char(255) DEFAULT NULL, `picureurl3` char(255) DEFAULT NULL, `picureurl4` char(255) DEFAULT NULL, `picureurl5` char(255) DEFAULT NULL, `picureurl6` char(255) DEFAULT NULL, `shangjiareason` char(255) DEFAULT NULL, `shimingreason` char(255) DEFAULT NULL, `neverreason` char(255) DEFAULT NULL, `shiming` enum('0','1','2','3') DEFAULT '0', `mecity` char(30) DEFAULT NULL, `mesex` char(100) DEFAULT NULL, `meage` char(100) DEFAULT NULL, `mestature` char(100) DEFAULT NULL, `mepaixu` char(100) DEFAULT NULL, `zhaohu` int(11) DEFAULT NULL, `star` tinyint(3) unsigned DEFAULT NULL, `picureurl7` char(255) DEFAULT NULL, `picureurl8` char(255) DEFAULT NULL, `sfzcode` char(25) DEFAULT NULL, `zsname` char(25) DEFAULT NULL, `dingweicity` char(30) DEFAULT NULL, `dingweiprovince` char(30) DEFAULT NULL, `shimingtime` datetime DEFAULT NULL, PRIMARY KEY (`userid`) ) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 | +-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> 而且现在还有bug,字符集插入数据库就显示4个????
xuzuning 2016-10-02
  • 打赏
  • 举报
回复
不知道你要做什么 mysql 存储 emoji 表情符,需选用 utf8mb4 字符集
  • 打赏
  • 举报
回复
zaidingyixia
  • 打赏
  • 举报
回复
我再顶顶顶顶
  • 打赏
  • 举报
回复
dingyixia

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧