There is a working site on ImageCMS , which needs to be transferred to another hosting. The corresponding files were successfully copied, it remains only to transfer the database. On a working site, the base encoding is utf8_unicode_ci , the tables in it are utf8_general_ci . Through phpMyAdmin , the database was exported to UTF-8 and, accordingly, imported to another site in the same configuration. As a result, the encoding in the database itself is such as needed, the field values ​​are identical to those in the original database.

The problem is that the CMS ceased to perceive the database and instead of Cyrillic on the site, either blank lines or are output. I think the problem is in the encoding settings on the server or somewhere else, but I can not figure out where. What could be the problem?



    2 answers 2

    It turned out that the problem is in the server settings, the solution method is specific and, apparently, is corrected by the CMS source code methods, namely by adding a line:

     $con->exec("SET NAMES 'UTF8'"); 

    Source of

      Try to force htaccess encoding

      • AddDefaultCharset UTF-8 - ukroficer
      • Also check this: config / database.php $ db ['default'] ['char_set'] = 'utf8'; $ db ['default'] ['dbcollat'] = 'utf8_general_ci'; - ukroficer
      • We need to look everywhere and bring everything to one - ukroficer
      • The directive " AddDefaultCharset UTF-8 " is registered in htaccess . - Crasher