On 15/11/10 14:00, Alessandro Topo Galileo wrote:
Quote:
Hello, I'me not able to solve a character set problem.
I have two linux PC: PC1 is OpenSuSE 10.2 and PC2 is OpenSuSE 11.3.
Database is on PC2.
Table has TABLE_COLLATION='latin1_swedish_ci'.
I must insert and select characters like "à", it has "E0" code on:
http://www.collation-charts.org/mysq...wedish_ci.html
I use command line mysql or connect from php, results are the same. |
Upon connecting to the database server, it is good to send a "SET NAMES"
command to set the character encoding. So if you want to speak UTF-8 to
your database, send the command "SET NAMES utf8".
The MySQL server defaults to speaking latin-1.
If you really want to make sure that the right character gets inserted
on whatever system, you can use encoding prefixes and hexadecimal
values. This can come in handy for database creation scripts. So your
lower case a grave can, for example, be denoted with "_utf8 0xC3A0".
MySQL itself will convert this character to whatever encoding the field has.
But normally, sending the SET NAMES command as the first statement and
"speaking" the encoding set in that statement does the job entirely.
Best regards,
--
Willem Bogaerts
Application smith
Kratz B.V.
http://www.kratz.nl/