M
M
miksha2014-07-22 18:16:55
PHP
miksha, 2014-07-22 18:16:55

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.
8dd3e352cc97452683660a10ea0ab031.png
The site displays questions in a rhombus instead of some letters.
The encoding seems to be correct.
fc6c1df6478f40cbbc9201558c608f6a.png
What could be the problem?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
Z
zooks, 2014-07-22
@miksha

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.

B
begemot_nn, 2014-07-22
@begemot_nn

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)

F
falsebyte, 2014-07-22
@falsebyte

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

S
Snewer, 2014-07-22
@Snewer

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

M
miksha, 2014-07-22
@miksha

We tried to add SET NAMES utf8 wherever possible. Dumped and registered there, nothing changes after import.
The problem is most likely this:
But we do not have the rights to change character_set_server, unfortunately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question