Kim
Kim

Reputation: 33

Select with Utf-8 in MySQL return wrong results

When I excute this query:

SELECT * FROM `PageMapLine` WHERE name = "không" 

The result include unexpected records like "Khổng" and "Khong":

id      name    pageID  stem    lemma
--------------------------------------
236040  Khổng   236040  NULL    NULL
494405  Không   494405  NULL    NULL
796340  Khong   796340  NULL    NULL
--------------------------------------

My table encoding was utf8_general_ci.

Upvotes: 1

Views: 316

Answers (1)

Carlos
Carlos

Reputation: 1822

It is because of your ci (case insensitive) codification. I would use utf8_bin instead. Remember to backup first.

Case insensitive is also insensitive to those special characters.

Upvotes: 1

Related Questions