Re: Character encodings issues with php, mysql, apache
Posted by:
Rick James
Date: March 28, 2009 04:04PM
1.
Do SET NAMES utf8
as the first thing after connecting to MySQL. If you can't do that in PhpAdmin, complain to them.
2.
SHOW CREATE TABLE tbl\G
to see the collation for the column(s) in question.
utf8_unicode_ci is the best all-around collation for UTF8, but may not properly handle Spanish peculiarities.
The utf8_spanish_ci and utf8_spanish2_ci collations correspond to modern Spanish and traditional Spanish, respectively. In both collations, ‘ñ’ (n-tilde) is a separate letter between ‘n’ and ‘o’. In addition, for traditional Spanish, ‘ch’ is a separate letter between ‘c’ and ‘d’, and ‘ll’ is a separate letter between ‘l’ and ‘m’