How to force SQL search to ignore special characters for a specific language?

I have a sql table that contains data with special characters for my language (Slovak), for example:

id | name 1 František 2 Ján 3 Júlia 

Now I need to start a search in this table (SELECT ...% string%), where when searching for julia it must match Júlia , or even in general, ju should find Júlia .

My database is already case insensitive, I just need to make it ignore these special characters.

How can I do it?

+4
source share
1 answer

Try

 select * from t where name like 'Julia' collate utf8_unicode_ci 

You can use a different sort in your settings.
You can see which mappings are supported by your installation.

 SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS 

SQLFiddle example
MySQL Collations

+4
source

Source: https://habr.com/ru/post/1439251/


All Articles