MySQL Forums
Forum List  »  PHP

Re: Searching with accented words
Posted by: Rick James
Date: May 10, 2009 03:02PM

Did you execute SET NAMES utf8 from PHP after connecting? Perhaps the data is not actually in utf8.

Do
SELECT field, hex(field), length(field), char_length(field)
FROM books WHERE id=...;
Spanish accented letters should take 2 bytes. If they are taking 4 bytes, then you hit the "double encoding" problem. This will be tricky to fix.

Suggest looking into utf8_spanish_ci collation; it will probably be more "correct" for Spanish author titles and authors (but less correct for non-Spanish). (This has no impact on your LIKE/MATCH question.)

Also please provide
* SHOW CREATE TABLE tbl\G
* SHOW TABLE STATUS LIKE 'tbl'\G
* EXPLAIN SELECT ...\G
and surround them with [ code ] and [ / code ]
There may be some more clues there.

Options: ReplyQuote


Subject
Written By
Posted
Re: Searching with accented words
May 10, 2009 03:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.