从网上的教程中找到一个方法,可以在Typecho中使用emoji,无论是正文还是评论都可以,这里记录一下,免得备案好了以后迁移内容忘记。我用的宝塔面板搭建的,故以宝塔面板为例。
参考内容:旧日的足迹博客
1、从后台进入数据库
在PhpMyadmin中选择typecho数据库,操作-->排序规则-->选择utf8mb4_unicode_ci然后执行。
2、修改表编码
执行sql语句
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、修改typecho配置文件config.inc.php
进入宝塔后台的文件
,并找到博客所在目录,例如我的目录为/www/wwwroot/博客名
,这个目录下会有config.inc.php
的一个文件。双击打开编辑。
在最下面找到:'charset' => 'utf8'
把utf8
修改为utf8mb4
大功告成!✌️