Answer the question
In order to leave comments, you need to log in
Sql like Russian words case insensitive in rails?
There was a problem, when querying the database, Russian (Cyrillic) words are compared case-sensitive, although at the same time Latin is compared case-insensitively.
Tried to defeat this with .mb_chars.downcase.to_s
and lower
in the query, but to no avail.
where('lower(first_name) like ?', name).mb_chars.downcase.to_s<br>
Answer the question
In order to leave comments, you need to log in
I figured out that this is a feature of sqlite, by default the lower function in it does not work for UTF-8, you need to either write your own function or take an sqlite assembly with unicode support. On production with mysql everything works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question