Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: PHP + Unicode

2 views
Skip to first unread message
Message has been deleted

Alvaro G Vicario

unread,
Aug 26, 2005, 2:56:06 AM8/26/05
to
*** will...@gmail.com wrote/escribió (25 Aug 2005 22:27:20 -0700):
> I have saved some data in a MySQL database as UTF-8 format. But when I
> tried
> to read the data using PHP, the webpage gave me all the "?"s. How to
> read it
> multilingual data correctly in PHP?

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
than:

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

tell it's UTF-8.

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

Message has been deleted

Oliver Grätz

unread,
Sep 3, 2005, 6:12:03 AM9/3/05
to
Try this before you output anything:

mb_http_output("UTF-8");
ob_start("mb_output_handler");

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.

AllOlli

0 new messages