Some UTF-8 character not sent unchanged to MySQL

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

When I submit a query containing a UTF-8 representation (hex
value 0xC48D) of the Unicode character &#x010D (lowercase c with
caron) to the MySQL server using mysql_query, sniffing the
network traffic reveals that the character is sent as 0xC43F,
which is not a valid UTF-8 character.

Some other Unicode characters are also problematic, including
&#x0110 and &#x00C1, but they are both sent as 0xC33F.

The MySQL table has been created with CHARACTER SET utf8.

Is this a PHP bug or a MySQL bug? Or am I misunderstanding
something here? Can someone confirm this behaviour?

I'm using PHP 5.0.2, MySQL 4.1.6gamma and Apache 2.0.49-27.16 on
SuSE Linux Professional 9.1. MySQL and PHP have been compiled by
me, Apache is the SuSE default.

Thanks for any help.

Stian Grytyr

Site Timeline