Page 1 of 1

Why cant display UTF-8?

Posted: Wed Feb 11, 2009 2:23 am
by jc
Look at my site: http://www.ntminishop.com

It's in Vietnamese (if not, change to Vietnamese). Notice that strings from db can be displayed nicely, but strings from locale files are all "Cam k?t. Ch�ng t�i cam k?t h�ng h�a ?�ng ch?t l??ng, ?�ng nh� cung c?p v� cam k?t giao h�ng khi Qu� kh�ch ??t h�ng."

I have tried do these things to fix it:

- Used and but it cant help.

- I also converted all php and tpl files to utf-8 too. NOT WORK! >:(

Help! Thanks in adv.

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 3:10 am
by Daniel
I'm releasing a fix tonight.

change;

mysql_query("SET CHARACTER SET utf8", $this->link);

to

mysql_query("SET NAMES 'utf8'", $this->link);
mysql_query("SET CHARACTER SET utf8", $this->link);

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 12:29 pm
by jc
Oh, those texts from db is good. It just can't display UTF-8 from language files.

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 12:45 pm
by jc
And really strange is this only occurs on linux host. It displayed well on wins.

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 6:32 pm
by JNeuhoff
Your site works fine, justed tested it using Firefox 3.0.5 on Ubuntu 8.10.

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 6:41 pm
by jc
Oh, I can't wait for the answer, so I used &#XXXX; type to temporary solve it. :(

You can try it by type some utf8 characters into language files and host it on a linux server. They all changed to �����...

Re: Why cant display UTF-8?

Posted: Wed Feb 11, 2009 8:28 pm
by JNeuhoff
Just tested it on my Linux server, and it works fine there, too.

Maybe your Linux webserver hasn't been correctly configured?