$ db是mysqli_connect(...);
创建的数据库的链接mysqli_set_charset($db,"UTF-8");
die(mysqli_character_set_name($db)); //returns (string) "latin1";
如何解决这个问题?
答案 0 :(得分:1)
MySQL无法识别" UTF-8"。使用" utf8"。
mysqli_set_charset($db,"utf8");
您可以获得MySQL识别的拼写列表:
SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.CHARACTER_SETS
WHERE CHARACTER_SET_NAME LIKE 'utf%';