1 (edited by kriko 2009-03-26 17:38)

Topic: Displaying recent posts - broken characters

I followed this example here:
http://punbb.informer.com/wiki/punbb13/ … t_10_posts
and I got a basic working sample to display recent 10 posts.

However some characters get broken, I see:
"Piši kar trenutno počneš"
instead of:
"Piši kar trenutno počneš"

What could be wrong? I examined viewtopic.php and I cannot see any extra magic happening in there that would explain why "čžš" is working inside forum, but not on above example.
I'm sure that creating a new query with php functions would work, as I do it for other parts of site (non-forum related).

Tables use utf8_general_ci collation.

Re: Displaying recent posts - broken characters

This problem is related with the charset. You should add this line to the top of the example:

header('Content-type: text/html; charset=utf-8');

I have corrected the example in wiki.

3

Re: Displaying recent posts - broken characters

Thanks!