Hi,

I'm not very good at encoding either, but from what I understood, the client specifies the encoding expected from the database,if you do a show variables like '%char%', you will have a line character_set_client. In your case this is probably set to latin_1.
If this is the case, mysql is sending the result declared as latin1 encoded.
The 'numbers' (hexadecimals value of your characters) are ok, but the utf8 encoded ones can't be represented properly thus the question marks. If this is the case you could try adding SET NAMES 'UTF8' before your queries.
detailed info here:
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

I think the second user comment may also be helpful.

hth,
melanie


From: Dave M G <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Subject: Re: Unable to duplicate a database at home, possible encoding problem
Date: Tue, 14 Feb 2006 00:06:42 +0900

MySQL List,

With the off list help of a member of this community, I have solved the issue of accessing my database data from within PHP. It was an issue related to PHP's register_globals setting.

However, the encoding issue remains. I've taken the text that pertains only to that, and reproduced it here in hopes that someone can give me some advice which will enable me to transport my utf8 encoded data from my hosting service to my home machine.

I can take the .sql file that I have exported from my hosting service, open it in OpenOffice Write as a text encoded file, and verify that it is encoded in utf-8. Most of the Japanese text shows up readable. Some of it, however, shows up as coded numbers (I'm not sure what the term is when utf displays this way): &#12513;&#12540;&#12531;&#12539;

When I import the .sql file into MySQL, I can look at it in phpMyAdmin and see that the text that displayed correctly as Japanese in OpenOffice still displays correctly as Japanese. The text that was in number form is also still in number form when viewed through phpMyAdmin. In short, phpMyAdmin sees it after import the same way that OpenOffice did before import.

But, then when I view a PHP file in FireFox, and it accesses the database that way, the situation changes. The text that is encoded as numbers displays as correct Japanese. The text that displays as actual Japanese text in OpenOffice and phpMyAdmin now displays as quesiton marks.

Again, just to be clear, all Japanese characters and all database data display correctly when viewed from the hosting service.

   I hope someone can shed some light on this.

   Thank you.

--
Dave M G

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


_________________________________________________________________
The new MSN Search Toolbar now includes Desktop search! http://toolbar.msn.co.uk/


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to