PHP + Unicode

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I have saved some data in a MySQL database as UTF-8 format. But when I
to read the data using PHP, the webpage gave me all the "?"s. How to
read it
multilingual data correctly in PHP?

I believe there must be a way since I can see the words in UTF-8 in the

phpmyadmin interface. phpmyadmin is also coded in PHP and if it can do
there must be a way to read multilingual data properly.

Anyone knows how to do it? Thanks a lot!


Re: PHP + Unicode

*** wrote/escribió (25 Aug 2005 22:27:20 -0700):
Quoted text here. Click to load it

Have you set the appropriate headers to tell browser what charset it should
use to decode? It may not be the solution but it's a necessary step. Rather

Content-Type: text/html; charset=ISO-8859-1

tell it's UTF-8.

-- Álvaro G. Vicario - Burgos, Spain
-- - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group

Re: PHP + Unicode

Yes, I set the appropriate headers to tell the browser it is UTF-8. But
it does not help!

Alvaro G Vicario wrote:

Quoted text here. Click to load it

Re: PHP + Unicode

Try this before you output anything:


It automagically converts to UTF-8. Other suggestion:
Have you set the Default-Charset in your httpd.conf? If I recall
correctly it overrides anything in your script if it is set.


Site Timeline