Dokuwiki最新版本”Anteater”支持用utf-8编码命名文件,这在LINUX系统下正常,但在中文WINXP下,就成乱码了,这是因为WINXP的默认字符编码是CP936。 参考dokuwiki上的解决办法,下面是我的一种解决办法 ■WinXP SP3 ■Apache2.2.8 ■PHP5.2.6 修改\inc\pageutils.php中utf8_encodeFN、utf8_decodeFN两个函数 function utf8_encodeFN($file,$safe=true){ global $conf; if($conf['fnencode'] == ‘utf-8′) { $file=mb_convert_encoding($file,”CP936″,”UTF-8″); return $file;} if($safe && preg_match(‘#^[a-zA-Z0-9/_\-\.%]+$#’,$file)){ return $file; } if($conf['fnencode'] == ‘safe’){ return SafeFN::encode($file); } $file = urlencode($file); $file = str_replace(‘%2F’,’/’,$file); return $file; } function utf8_decodeFN($file){ global $conf; if($conf['fnencode'] == ‘utf-8′) { $file=mb_convert_encoding($file,”UTF-8″,”CP936″); return $file;} if($conf['fnencode'] == ‘safe’){ return SafeFN::decode($file); [...]