但是将站点部署到一个Windows XP 中文版上时,发现上传的附件在服务器的文件名为乱码,而URL是正常的,说明是操作系统编码的问题,windows中文版的编码好像是GBK(以前在Windows下开发时输出的系统编码好像是GBK,不太确定,有兴趣的可以自己在Win下测试)。解决方案: 1.如果非要部署wordpress到Windows XP系统,更换Windows XP English version 2.如果非要部署wordpress到Windows XP 中文版,修改以下代码: //wp-admin/includes/file.PHP,以3.0.3为例: <div class="msgborder" id="phpcode1"> function wp_handle_upload( &$file,$overrides = false,$time = null ) { //.... // Move the file to the uploads dir //$new_file = $uploads['path'] . "/$filename"; // 修正中文文件名编码问题 $new_file = $uploads['path'] . "/" . iconv("UTF-8","GB2312",$filename); //... //return apply_filters( 'wp_handle_upload',array( 'file' => $new_file,'url' => $url,'type' => $type ),'upload' ); // 修正中文文件名编码问题 return apply_filters( 'wp_handle_upload',array( 'file' => $uploads['path'] . "/$filename",'upload');