博客维护 | 使typecho支持emoji

修改点:

mysql数据库初始为utf8,需要修改为utf8mb4

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;

typecho配置文件修改

$db->addServer(array (
    'host'      =>  localhost,
    'user'      =>  'me',
    'password'  =>  'my_password',
    'charset'   =>  'utf8mb4', //修改这一行
    'port'      =>  3306,
    'database'  =>  '蛤?'
), Typecho_Db::READ | Typecho_Db::WRITE);

参考资料:

  • [使 Typecho 支持 emoji 的显示

本文链接:

https://wiki.ohiyox.in/archives/4/
1 + 9 =
快来做第一个评论的人吧~