我的wordpress中文乱码处理方法–快把我搞死了^_^

Posted by admin on April 6, 2008 in 工作室链接 Views:731 views

用phpMyAdmin打开wordpress数据库,乱码,但是从wordpress浏览正常,用phpMyAdmin导出sql备份为乱码,并不可恢复.

经查:
MySQL 版本 4.1.7 ,
编码为 DEFAULT CHARSET=latin1,
collation 为 latin1_general_ci

通过 WP-DB Backup 插件备份wordpress数据库,无乱码.

修改用WP-DB Backup导出的文件,把DEFAULT CHARSET=latin1替换为DEFAULT CHARSET=utf8,重新导入,一切OK,Collation也为utf8_general_ci.

修改wp-includes/wp-db.php

$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
//加入以下一行
$this->query(”SET NAMES ‘utf8′”);

Comment

Log in or Register to post a comment.

More

Read more posts by admin

About the Author

seamaple

转租纪翟南路188弄香港花园主卧700元/月(已成交) 一个城市在我心中的没落