BLOG:CMS :: Support Forum

Support Forum for BLOG:CMS

You are not logged in.

#1 18.05.2009 11:16

zombux
BLOG:CMS Senior
From: Czech Republic
Registered: 06.10.2004
Posts: 98

utf8 + PHP 5.2.4+

I have a delicate problem, hopefully someone can help me out.

my BLOG:CMS installation worked fine for years, but after my hosting upgraded to latest PHP and Apache, something went wrong. after a short research I found out this is the problem:

Page headers already sent
The page headers have already been sent out in /home/www/zombux.net/subdomeny/www/admin/libs/db.php line 114.

the troublesome code is this:

        mysql_query('SET CHARACTER SET utf8');
        mysql_query('SET collation_connection = utf8_czech_ci');

suddenly this doesn't work correctly. if I comment these out, it works but without UTF8 encoding, therefore all non-english characters are ?.

at php manual I found out that this code is now deprecated (since PHP 5.2.4), and I should use
mysql_set_charset('utf8');

however this gives the same error. it seems I'm out of luck on this sad

thanks for any advice.

Offline

 

#2 18.05.2009 13:36

zombux
BLOG:CMS Senior
From: Czech Republic
Registered: 06.10.2004
Posts: 98

Re: utf8 + PHP 5.2.4+

oh, by the way I'm using some old BLOG:CMS 3.5.6 or whatever it is. unfortunately it's very heavily modified, so any upgrade is impossible sad

Offline

 

#3 19.05.2009 07:40

zombux
BLOG:CMS Senior
From: Czech Republic
Registered: 06.10.2004
Posts: 98

Re: utf8 + PHP 5.2.4+

OK here we go. problem fixed. the solution is:
mysqli_set_charset($activedb,'utf8');

Offline

 

#4 20.05.2009 00:26

Radek Hulán
Site Admin
From: Prague, Czech Republic
Registered: 17.03.2004
Posts: 2509
Website

Re: utf8 + PHP 5.2.4+

Seems your webhost migrated from MySQL to MySQLi extension.

This should do the trick as well - in libs/db.php, sql_select_db() function:

Code:

sql_query("SET NAMES 'utf8'");
sql_query("SET CHARACTER SET 'utf8'");

--= BLOG:CMS developer =--

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

TOPlist