Typecho支持emoji表情,设置数据库编码格式为 UTF8MB4
phpmyadmin
操作 → 排序规则 → 选择“utf8mb4_unicode_ci”并点击执行
image.png
SQL执行以下sql(如果安装时改过前缀 也需要修改前缀)
代码语言:javascript复制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;
php
最后在网站根目录config.inc.php配置文件中将utf8改为utf8mb4
代码语言:javascript复制'host' => localhost,
'user' => 'youruser',
'password' => 'yourpassword',
'charset' => 'utf8mb4', //将utf8修改为utf8mb4