使Typecho支持Emoji表情?
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;
修改config.inc.php的配置
/** 定义数据库参数 */
$db = new Typecho_Db('Pdo_Mysql', 'typecho_');
$db->addServer(array (
'host' => 'localhost',
'user' => 'user',
'password' => '1234',
'charset' => 'utf8mb4',
'port' => '3306',
'database' => 'Typecho',
), Typecho_Db::READ | Typecho_Db::WRITE);
Typecho_Db::set($db);
即可