2006-09-04, 11:43 AM
I admire your efforts to switch to utf8 (having in mind those scanf/printf php functions) but sometimes it's better to either do/test completely such ideas in advance or dont include them at all:
I suggest a mod. to db_mysql's connect function like:
And an example for DB as follows:
Another little bug is in parsing settings.php's encoding. If you type in forum's name in different than eng. language (via install.php) you will end up with "??? ???? ??????" when your forum displays it directly in utf8.
BTW, I've noticed there is a slight difference between those functions in db_mysql.php and db_mysqli.php - last one does not check for persistant connections. Does this have to do with the fact that db_mysqli.php (under Windows) uses ODBC (there goes "improved" Mysql support )?!?
P.S. It is not funny to see reasonable posts like "either reinstall or forget about updating" esp. for ppl who use your forum on several sites. I hope next "major" update wont be such pain in the lime
I like this forum and it's functionality but if I have to spend several days to sync. databases manually, each time you release "updates" - It will force me to switch to another forum...
Edit: For those who would argue about staticly setting encoding to utf8 - I would like to remind them to check what UTF8 was created for...
- First you should have warned ppl for this (at least in the changelog), as some use different langs than english and this (upgrade.php) could totally screw up their data.
- Second you should set collations in DB schema for the new install (which I had to relly on as it turned out updating from 1.1.8 is a hell of a nightmare).
- And of course, third ... you should set DB connection's collation to UTF8 too (e.g. in db_mysql.php)! Not all servers are configured to support this by default so it is imperative to select it...
I suggest a mod. to db_mysql's connect function like:
function connect($hostname="localhost", $username="root", $password="", $pconnect=0)
{
if($pconnect)
{
$this->link = @mysql_pconnect($hostname, $username, $password) or $this->dberror();
}
else
{
$this->link = @mysql_connect($hostname, $username, $password) or $this->dberror();
}
mysql_query('SET NAMES utf8;',$this->link);
mysql_query('SET CHARACTER SET utf8;',$this->link);
mysql_query('SET CHARACTER_SET_DATABASE = utf8;',$this->link);
return $this->link;
}
And an example for DB as follows:
CREATE TABLE `mybb_adminlog` (
`uid` int(10) unsigned NOT NULL default '0',
`dateline` bigint(30) NOT NULL default '0',
`scriptname` varchar(50) collate utf8_general_ci NOT NULL default '',
`action` varchar(50) collate utf8_general_ci NOT NULL default '',
`querystring` varchar(150) collate utf8_general_ci NOT NULL default '',
`ipaddress` varchar(50) collate utf8_general_ci NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Another little bug is in parsing settings.php's encoding. If you type in forum's name in different than eng. language (via install.php) you will end up with "??? ???? ??????" when your forum displays it directly in utf8.
BTW, I've noticed there is a slight difference between those functions in db_mysql.php and db_mysqli.php - last one does not check for persistant connections. Does this have to do with the fact that db_mysqli.php (under Windows) uses ODBC (there goes "improved" Mysql support )?!?
P.S. It is not funny to see reasonable posts like "either reinstall or forget about updating" esp. for ppl who use your forum on several sites. I hope next "major" update wont be such pain in the lime
I like this forum and it's functionality but if I have to spend several days to sync. databases manually, each time you release "updates" - It will force me to switch to another forum...
Edit: For those who would argue about staticly setting encoding to utf8 - I would like to remind them to check what UTF8 was created for...