1

I've got a problem with UTF-8 charset and french characters (é, è,...).

My PHP scripts are all encoded in UTF-8 without BOM. At least I think it's the case.

The MySQL Tables are set to use utf8_general_ci.

The PHP scripts display characters correctly, but PHPMyAdmin display characters incorrectly (eg. : "é" instead of "é").

Do you have an idea about the cause of the problem ?

Thanks in advance for your help.

Qirel
  • 25,449
  • 7
  • 45
  • 62
  • 2
    I have previously written [**an answer**](http://stackoverflow.com/questions/31897407/mysql-and-php-utf-8-with-cyrillic-characters/31899827#31899827) that lists the most common issues with MySQL/PHP charset. There's also [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through). I can almost guarantee you'll find your solution in either one or both of those questions :-) – Qirel Mar 23 '17 at 22:49
  • If you do `insert into table values ('é')` on phpmyadmin. Does the character go in? If so it is probably something with the PHP connection. If not it is something with the DB set up and PHP is irrelevant. – chris85 Mar 23 '17 at 22:55
  • chris85, yes, if I write the "é" directly in PHPMyAdmin there's no problem, the string is then displayed correctly. Problem comes from PHP only. – jSynergistic Mar 24 '17 at 07:22
  • Use the `@` to tag. Then the issue is between the PHP file and transmission to DB. Add your PHP code. Did you set the connection to use utf8? – chris85 Mar 24 '17 at 15:33
  • Thanks Qirel, I should have searched more deeply before asking. Your thread resolved my problem. Sorry for the duplicate. – jSynergistic Mar 24 '17 at 23:23
  • You have "Mojibake" -- Read about such [_here_](http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored) – Rick James Mar 29 '17 at 16:37

0 Answers0