J
J
Jean-Claude2019-06-16 18:41:49
PHP
Jean-Claude, 2019-06-16 18:41:49

How to solve the problem with mysql / php encodings on a new hosting?

There is one project, everything works great on local and old hosting. Since the resources of the old hosting were not enough, and there was no longer a higher tariff, I transferred it to a new hosting. I work with utf8, the information is displayed on the site using jquery ajax.
Encoding problems started. Initially, the mysql database with utf8mb4_general_ci encoding, the utf8_bin table - all this worked fine on the old hosting and for some time on the new one. Then I look at the porridge in the database:
On the site, some words are displayed like this �?нформация, in the database they are displayed like this полной информации(and the ajax response from the script comes in the same form).
Although everything is clear on the LAN, on the LAN in phpmyadmin I see Russian words, and not полной информации.
header('Content-Type: text/html; charset=UTF-8'), it's all there. Where to dig? <meta charset="utf-8">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shokhrov, 2019-06-16
@Jean-Claude

mysqli_set_charset ?
( ex mysql_set_charset )
Well, look where the data with the bugs in the database came from, in that direction and dig.
UPD Spoiler: the new hoster started MySQL with the flag --skip-character-set-client-handshake, which led to troubles with RєСЂР°РєРѕР·СЏР±СЂР°РјРё.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question