如何在Typecho显示Emoji表情

J的故事
2020-12-15 / 0 评论 / 3,333 阅读 / 正在检测是否收录...

解决方法

1.先进入数据库面板,点击SQL运行下列语句(粘贴SQL语句执行即可):
请输入图片描述
SQL语句

alter table typecho_comments convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_contents convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_fields convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_metas convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_options convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_relationships convert to character set utf8mb4 collate utf8mb4_general_ci;
alter table typecho_users convert to character set utf8mb4 collate utf8mb4_general_ci;

2.修改Typecho根目录下config.inc.php文件,大约在60行
请输入图片描述
修改文件

/** 定义数据库参数 */
$db = new Typecho_Db('Pdo_Mysql', 'typecho_');
$db->addServer(array (
  ...
  'charset' => 'utf8mb4',  // 将原来的utf8修改为 utf8mb4
  ...
), Typecho_Db::READ | Typecho_Db::WRITE);
Typecho_Db::set($db);[/card]
0

评论 (0)

取消