前言
由于编码的问题 Typecho 默认不支持emoji表情,而是需要我们手动将默认的数据库编码utf8修改为utf8mb4即可,当然别忘了,utf8mb4编码只有在PHP5.5以后才支持。下面就简单记录一下整个修改步骤:
1.修改数据库编码
进入`PhpMyadmin`,选择您的数据库,操作->整理->选择`utf8mb4_unicode_ci`
2.修改数据库表编码
alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_relationships convert to character set utf8mb4 collate utf8mb4_unicode_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_unicode_ci;
3、修改数据库配置文件
网站根目录数据库配置文件config.inc.php
$db->addServer(array (
'host' => localhost,
'user' => 'youruser',
'password' => 'yourpassword',
'charset' => 'utf8mb4', //修改这一行将uft8修改为utf8mb4
'port' => 3306,
'database' => 'yourdatabase'
), Typecho_Db::READ | Typecho_Db::WRITE);
然后就搞定了!
✗哭了✗ 测试评论!
测试回复