For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > October 2007 > Special chars & UTF-8: sometimes ok, sometimes wrong









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Special chars & UTF-8: sometimes ok, sometimes wrong
thomas Armstrong

2007-10-18, 6:59 pm

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=F1a' 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?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com