ć and alike

BubikolRamios's profile image BubikolRamios posted 9 years ago in General Permalink
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's profile image ansgar posted 9 years ago Permalink
That's a problem with the collation of the column. Which collation is it?
BubikolRamios's profile image BubikolRamios posted 9 years ago Permalink
utf8_slovenian_ci
BubikolRamios's profile image BubikolRamios posted 9 years ago Permalink
looks strange that colation is problem, heidi shows sample content in that col right: 'Morski konjić'
kalvaro's profile image kalvaro posted 9 years ago Permalink
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's profile image BubikolRamios posted 9 years ago Permalink
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's profile image kalvaro posted 9 years ago Permalink
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.