Answer the question
In order to leave comments, you need to log in
What encoding to choose for the base so that you can save strings in any language and not soar your brain?
Made a migration
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
I added a model, I send post data with Cyrillic, save () works, but the Latin gets into the database, and there is an empty space from the Cyrillic ... I'm afraid to guess what will happen if someone writes in Arabic, Chinese or Hindi. What to do?
Answer the question
In order to leave comments, you need to log in
It is worth setting utf8mb4_unicode_ci everywhere (it works more accurately when sorting, etc.) or utf8mb4_general_ci (it works a little faster, extremely slightly, so the first option makes sense).
PS The above utf8_general_ci/utf8_unicode_ci support only half of the utf8 range, hence saving, for example, emoji, will be physically impossible.
PPS The "ci" suffix means Case Insensitive (case insensitive when searching and comparing).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question