我目前正在通过使用 php 行强制来自服务器的数据符合 UTF:
$name = iconv('UTF-8', 'UTF-8//TRANSLIT', $name);
这在我运行 php 5.3 但不是 5.4 的服务器上完美运行。(不确定版本是否相关)。运行5.3的服务器是unix,运行5.4的服务器是ubuntu 12.04。
有一个更好的方法吗?我错过了什么吗?
编辑:只是要清楚:
$name before: 东西——副标题
$name after on 5.3: 东西
$name 在 5.4 之后:null