ć and alike

BubikolRamios posted 4 years ago in General
select * from table where f like '%ć%' and not like '%c%'

gets nothing

select * from table where flike '%ć%'

gets all the stuff containing 'c'

Is that MySQL or Heidi problem ?
ansgar posted 4 years ago
That's a problem with the collation of the column. Which collation is it?
BubikolRamios posted 4 years ago
utf8_slovenian_ci
BubikolRamios posted 4 years ago
looks strange that colation is problem, heidi shows sample content in that col right: 'Morski konjić'
kalvaro posted 4 years ago
Collation has absolutely nothing to do with display. Collation is the set of rules you use to compare characters and decide whether they're equal or which comes first when sorting.

Wikipedia says that ć and c are different letters but MySQL doesn't seem to be aware of that. If the server doesn't get it right, there isn't much you can do from the client.

You try binary comparisons:

SELECT BINARY _utf8'ć'=_utf8'c' AS 'Binary',
_utf8'ć' COLLATE utf8_slovenian_ci = _utf8'c' COLLATE utf8_slovenian_ci AS 'Slovenian';
Binary  Slovenian
0       1


Of course, you no longer have case insensitive comparisons.
BubikolRamios posted 4 years ago
so, I should use cp1250_croatian_ci ? https://dev.mysql.com/doc/refman/5.1/en/charset-ce-sets.html

Coz croatian alphabet contains all slovenian characters + extra ć,đ etc


Can you explain what is the diff between cp1250_croatian_ci and latin2_croatian_ci
from upper link ?
kalvaro posted 4 years ago
I can't see the gain: as per the chart MySQL's cp1250_croatian_ci implementation considers ć and c different letters as well.

Please login to leave a reply, or register at first.