The problem is that when using order_by()
, Ukrainian letters are incorrectly sorted alphabetically, that is, before "а", "б" is placed "і" and "є".
The problem is that when using order_by()
, Ukrainian letters are incorrectly sorted alphabetically, that is, before "а", "б" is placed "і" and "є".
2
Answers
Changing the column encoding to
utf8mb4_unicode_ci
helped me. PS. Failed to change the encoding of the entire database or table. Only the column.But later it turned out that this was not enough for me. I need to sort addresses that contain letters and numbers. In the end I was able to do it the way I needed with Natsort
You can change the collation of all columns of a table this way:
There’s no statement to change all tables in one operation. You have to do it one table at a time.