Prerequisites: mysql version ≥ 4.1
1. modify my. ini in the MySQL directory
# Default-character-set = Latin1
Default-character-set = utf8
2. Modify WP-DES/wp-db.php
Add the set_charset ($ charset) function to the object wpdb ):
Class wpdb {
Function set_charset ($ charset)
{
// Check MySQL version first.
$ Serverversion = mysql_get_server_info ($ this-> DBH );
$ Version = explode ('.', $ serverversion );
If ($ version [0] <4) return;
// Check if utf8 support was compiled in
$ Result = mysql_query ("show character set like 'utf8'", $ this-> DBH );
If (mysql_num_rows ($ result) <= 0)
Return;
If ($ charset = 'utf-8' | $ charset = 'utf-8 ')
$ Charset = 'utf8 ';
@ Mysql_query ("set names '$ charset'", $ this-> DBH );
}
}
3. Modify the wp-settings.php under the wordpressmu root directory:
Require (abspath. wpinc. '/vars. php ');
$ Wpdb-> set_charset (get_bloginfo ('charset'); // Add at this
4. Recreate the wordpressmu database (reinstall wordpressmu ).