MySQL charset

MySQL charset

am 20.12.2005 08:34:16 von ironcito

Hello,

I'm using PHP with MySQL. I have MySQL configured to use UTF-8 (Server
Administrator shows utf8 as the charset for everything). I have set up
Apache to send UTF-8 as the charset, and I've checked with Firefox that
it is displaying my page in UTF-8. However, when I display the results
of a query, non-ASCII characters appear incorrectly. I've included
mysql_client_encoding in my page, and it reports the charset as
"latin1_swedish_ci", but I've changed it to UTF-8 everywhere. What have
I missed?
Thanks in advance!

Diego

Re: MySQL charset

am 20.12.2005 09:21:51 von Shion

ironcito wrote:

> I'm using PHP with MySQL. I have MySQL configured to use UTF-8 (Server
> Administrator shows utf8 as the charset for everything). I have set up
> Apache to send UTF-8 as the charset, and I've checked with Firefox that
> it is displaying my page in UTF-8. However, when I display the results
> of a query, non-ASCII characters appear incorrectly. I've included
> mysql_client_encoding in my page, and it reports the charset as
> "latin1_swedish_ci", but I've changed it to UTF-8 everywhere. What have
> I missed?

latin1_swedish_ci is iso-8859-1, you need to set utf8


//Aho

Re: MySQL charset

am 20.12.2005 23:38:42 von ironcito

J.O. Aho wrote:

> latin1_swedish_ci is iso-8859-1, you need to set utf8

I know, but where? I've changed MySQL's charset to UTF8, the Server
Administrator says the charset is UTF-8... I don't know where that
latin1_swedish_ci is coming from.

Diego

Re: MySQL charset

am 20.12.2005 23:59:28 von Shion

ironcito wrote:
> J.O. Aho wrote:
>
>> latin1_swedish_ci is iso-8859-1, you need to set utf8
>
> I know, but where? I've changed MySQL's charset to UTF8, the Server
> Administrator says the charset is UTF-8... I don't know where that
> latin1_swedish_ci is coming from.

Tables can be of a different character set than default database character
set, specially if the character set has been changed after you created the
created your database.

I do suggest you start looking here:
http://www.mysql.com/search/?q=latin1_swedish_ci&x=0&y=0&doc =1&m=0

and specially how to alter character setups:
http://dev.mysql.com/doc/refman/5.0/en/charset-database.html

I know it's the mysql 5 manual, but this is supported in mysql 4 as far as I know.


//Aho