Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Can't say for sure, but it might help.
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
I can assume that you wrote a site in Notepad ++ or a table in Excel in windows 1251 encoding
. Because if you write projects in the IDE, the encoding is set there even before the project is created, and all subsequent files are created in the same encoding from the settings.
If I guessed right with the table, then create an empty Excel document , go to the "data" tab , "getting external data" , "from text" , select the table, set the encoding to utf-8 , separator ";" and save as csvfile, in this encoding, now you can upload it to the database and not worry, everything will be in Russian without any questions.
I can also assume that the table was created in the wrong encoding, go to PhpMyAdmin and see what kind of encoding the table itself has, and each row in the table, if the site is in UTF-8 , then the table should have utf_8_general_ci - it seems like this is written.
---
Migrations - https://yiiframework.com.ua/ru/doc/guide/2/db-migr...
Creating and deleting tables - https://metanit.com/web/php/7.3.php
Creating MySQL databases - php.net/manual/ru/function.mysql-create-db.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question