mercredi 6 mai 2015

Comparing strings of utf8mb4?

I wanted to find a string in my MySQL database, I have set the server COLLATION to utf8mb4. I have stored data in the tables of the MySQL database as arabic characters, but whenever I use the SELECT query command it doesn't return anything inside of my java application, but when I search in PhPMyAdmin it returns just fine, why is that? I have tried to set the COLLATION inside the query of my java application, but still it doesn't return any results...

However if I store data as regular ASCII it returns just fine, even though it's collated to utf8mb4, WHY?

query = "SELECT * FROM `listofprisoners` WHERE `NAME` LIKE '%داروان%' COLLATE utf8mb4_unicode_520_ci";

Aucun commentaire:

Enregistrer un commentaire