MySQL and Polish words

I noticed a problem with "non-English" (Polish) characters using MySQL.

query "select 'abcde' = 'ąbćdę'" returns "1" and the rows are not equal ...

Could you help me? :) thanks !!!

+5
source share
2 answers

For utf8_general_ci they are equal (except for ł, which is not considered a MySQL error), and with 5.6 you can also use utf8_unicode_520_ci, which correctly processes all Polish characters. Use utf8_polish_ci to treat accented and unstressed characters as different.

select 'abcde'='ąbćdę' COLLATE utf8_polish_ci
>> 0

Demonstration "no mistake"

select 'abcde'='ąbćdę' COLLATE utf8_general_ci
>> 1

select 'abcdel'='ąbćdęł' COLLATE utf8_general_ci
>> 0

See the bug report here: http://bugs.mysql.com/bug.php?id=9604

+9

Ł L ł l MYSQL, :

SELECT REPLACE(REPLACE('abcdel', 'Ł', 'L'), 'ł', 'l') = REPLACE(REPLACE('ąbćdęł', 'Ł', 'L'), 'ł', 'l') COLLATE utf8_general_ci
>> 1

.

-3

All Articles