0

First I read that question's anwser but that didn't help. I added mysqli_set_charset($cnx, 'utf8mb4'); or mysqli_set_charset($cnx, 'utf8'); with no luck.

I'm storing strings in a mysql database, with utf8_general_ci.

I have accented characters, for example in phpmyadmin I have É that will become É with a simple mysql select and php print.

But on my new server, after I copied all files and restored a dump with mysql -p < dump.sql, that stays É when displayed on the page.

Other strings on the page are displayed normaly, only those comming from mysql have the problem. But I don't understand the cause as the files and database are the same that on my old server.

Entretoize
  • 2,124
  • 3
  • 23
  • 44
  • Why a downvote ? – Entretoize Jan 22 '20 at 16:41
  • See "Mojibake" in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Jan 23 '20 at 07:08
  • This is a general anwser, my problem is specific, I have the same script and the same bdd, so the problem must be in the php or mysqlserver configuration. – Entretoize Jan 23 '20 at 08:32
  • There are at least 4 things that must be set correctly to make UTF-8 work correctly. Mojibake is one of about 5 symptoms of not having set things correctly. You have not provided enough details to say which thing is not set correctly, but the linked query does provide the necessary details (plus other stuff). – Rick James Jan 23 '20 at 15:55

0 Answers0