Take the 2-minute tour ×  I'm having an issue with encoding in
MySQL, and I need some help in figuring out what's going on.
First, some parameters. The default encoding of the table is
utf8. The character_set_client, character_set_connection,
collation_connection, and character_set_server MySQL system
variables, though, are all latin1.  I ssh into my MySQL server
and I connect to the local server using the local command line
client. I select record/column and the string that's returned,
let's say the character comes back as A, which is correct. A is
represented by hex in UTF-8 as "C5 9F."  However, the PHP app
that hits the server interprets it as XY. In the MySQL
commandline client, if I send the command "SET NAMES utf8", it
will also now display it as XY.  If I do a select INTO OUTFILE
and use hexedit to edit the file, I see two hex characters that
map to X, then two hex characters that map to Y. ("c3 85" for X
and "C5 B8" for Y). Basically, it's taking the two hex values
and displaying them indeed as UTF8