On Tue, 08 Aug 2006 18:00:29 +0100
Colin Guthrie <[EMAIL PROTECTED]> wrote:

> > - If I copy and paste greek characters from the db table into a string
> > in my PHP script, and output that, it works just FINE, without any
> > htmlentities() or other functions.
> > 
> > I'm at a loss.  What am I doing wrong?
> 
> That I don't know :)
> 
> I'm guessing that there may be some setting inbetween the PHP and mysql 
> layer that is mangling things.

Or maybe MySQL needs to be running in the UTF-8 locale. Try mysqldump
to get some text in a file and make sure it's really UTF-8. There are
a number of ways to tell if something is UTF-8. One is to create an
ASCII string with one non-ascii character like 'hĂȘllo' in the db and
then hexdump some mysqldump output. You should see single bytes for the
ASCII characters and then two or more bytes for the non-ascii character.

In general I would say a conversion is taking place somewhere. To fix,
verify what encoding is being used by mysql, the mysql client, PHP,
Apache, and the browser. If any one of those does not clearly output
UTF-8 the chain is broken. Start with MySQL and work your way down.

Mike

BTW: htmlentities has nothing to do with character conversions.

-- 
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to