Answer the question
In order to leave comments, you need to log in
Problem with encoding in MySQL. What can be done?
Good afternoon. Installed the recently released Pagekit CMS. There was a problem with the Cyrillic alphabet in the database.
The site displays questions in a rhombus instead of some letters.
The encoding seems to be correct.
What could be the problem?
Answer the question
In order to leave comments, you need to log in
Right now, only the utf8_unicode_ci collation is specified, and the encoding is not utf8 .
Create a database with utf8 encoding and utf8_general_ci mapping, then install the required CMS.
From what you can see in your first screenshot, it's very likely that 1251 and UTF are not the same,
or the data is in UTF and the mapping is in 1251 or vice versa.
such a hat can be (as one of the options) if you have php scripts in which work with the database is stored in 1251 and the database stores UTF. (or vice versa)
You can try in the mysql settings to specify
[client]
default-character-set = utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
character-set-server = utf8
collation-server = utf8_unicode_ci
skip-character-set-client-handshake
As an option, try to add a request to the CMS "SET NAMES utf8" before subsequent mysql requests.
Another option: "AddDefaultCharset utf-8" in .htaccess
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question