New answers tagged utf-8
MySQL and MariaDB handle character sets the same. However... Different versions of MySQL have different defaults. Ditto for MariaDB. SET NAMES declares what encoding is in the client. This is independent of the CHARACTER SET on a column or table. (There are, of course, characters that are not representable in latin1, so there can be conversion problems....
Got it! You must ensure that all parties (your app, mysql connection, your table or column) have set utf8 as charset. In my case all my scripts are routed so I just added this to my index.php: header('Content-Type: text/html; charset=utf-8'); Ensure your mysqli connection use utf8 before any operation: $mysqli->set_charset('utf8') And of course ...
A Google of "mysql accent insensitive search" produces various links with various "tricks" - which all seem to invalidate any indexes you may have on your table. I had to implement something similar years ago for Irish names and addresses which may contain accents. The strategy (if your RDBMS doesn't support accent insensitive searches) is to use a ...
You just need to tell MySQL to use a different collation. So, in your case: select * from t1 where description like 'instruccion' collate utf8_general_ci; ci means Case Insensitive, and it flattens accents as well as lower-casing. Example SQL Fiddle here.
Top 50 recent answers are included