Special chars & UTF-8: sometimes ok, sometimes wrong

From: Date: Thu, 18 Oct 2007 16:03:15 +0000
Subject: Special chars & UTF-8: sometimes ok, sometimes wrong
Groups: php.db 
Request: Send a blank email to php-db+get-44232@lists.php.net to get a copy of this message
Hi. Working with PHP 4.4 and mySQL 4.1, I've got some texts stored in a UTF-8 table with special chars. I serve a UTF-8 header within my HTML, Apache is configured to serve UTF-8 and PHP scripts are saved in UTF-8 charset. However, sometimes I get 'España' and other times 'Espa�a'. The difference? I press F5 (Refresh) bottom on my web browser (I use Firefox and Internet Explorer). This is the first time I experience this issue. When I have suffered problems with special chars I use utf8_decode or utf8_encode, but I always try to store text data in UTF-8 charset and serve them always with UTF-8 PHP scripts. However, this is a very odd issue, since it happens only with text taken from DataBase, but not from texts written in scripts :( Any similar experience?

« previous php.db (#44232) next »