因为wordpress默认不支持中文字符编码,我们需要改下让它支持,以下是wordpress 3.0.1的修改方法。
打开 WP-include/classes.php,新版的(3.1+)为 WP-include/class-wp.php(2011-07-13注)。
找到第154行(新版为142行),把:
$pathinfo = $_SERVER['PATH_INFO'];
替换为:
$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], 'UTF-8', 'GBK');
找到第159行(新版为147行),把:
$req_uri = $_SERVER['REQUEST_URI'];
替换为:
$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], 'UTF-8', 'GBK');
文章评论