1 (edited by AndersB 2009-03-17 06:44)

Topic: Encoding problems when trying to display forum content outside of foru

Hello, I'm trying to display my news from a special category in the forum on the front page.
But I get these encoding problems as shown in the image. It's the swedish character Ä that
is haunting me.
http://bennehag.com/pics/screen4.png

The foo_posts-table is utf8-general-ci according to phpMyAdmin and the html-file is also utf8:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

More details
The result from the query is just echo'ed without any special work performed on it.
The data displays fine in phpMyAdmin.

So the question is, does PunBB perform any post-processing of the string after reading from
the database? I have tried looking into the source but it is still a bit advanced for me.

2

Re: Encoding problems when trying to display forum content outside of foru

I believe the function to run on the string is now called forum_htmlencode().

3 (edited by AndersB 2009-03-17 17:36)

Re: Encoding problems when trying to display forum content outside of foru

Doing that returns an empty string I'm afraid.

I solved it. It was related to the connection between php and mySql.
Performing a

mysql_set_charset('utf8',$objConn); 

immediately after connecting to the database solved it.

See http://www.phpwact.org/php/i18n/utf-8/mysql