I find that the data stored in the DB is latin1-encoded even though my data is utf-8... phpMyAdmin cannot display the data correctly.. Of course, the forum is running fine...
The problem is when I start to transfer the data to a different server (website)... After exporting data, when importing from phpMyAdmin, the data is latin1 or utf8?? I check the data from the exporting file, and I find that it is encoded in latin1 (ENGINE=MyISAM)... but when treating utf8 data as latin1, some characters are unknown and hence result in the symbol "?".
Gorin is right. The default charset of mysql (at least on my server) is latin_swedish_1. And when miniBB connects to mysql, does not identify the charset, the default will take effect. I think.
The workaround for me now then:
* From the exporting data file, I re-encode the data back to utf-8 (luckily for me, I just start the forum for a week, so I only have 300 posts to re-encode)
* change to ENGINE=MyISAM DEFAULT CHARSET=utf8, for all the tables in the exporting data file
* Import the data back in the new server
* In the file setup_mysql.php, add the line: mysql_query("SET NAMES 'utf8'"); right after @mysql_select_db($DBname) or die ('<b>Database/configuration error (DB is missing).</b>');
After the above line is added to the code, now I can post new messages and retrieve old messages... successfully in utf-8. And a bonus, now I can see actual data displayed correctly in phyMyAdmin!!!
Unless anyone can come up with a better solution??? |