问题
My database is "utf8_general_ci", tables & columns are also "utf8_general_ci". Php file is also saved in UT8, I got the header in UTF8, so ... everything is UTF8.
But I still got that � char when there is accents.
I checked with iconv and it is UTF8. I also tested the encoding with mb_detect_encoding and the result is the same UTF8.
This drive me crazy ...
I got one thing to work : utf8_encode($string) this give me "Actualité" instead of "Actualit�s"
Is it possible this has been double-utf8 encoded ?
How can I fix this ?
回答1:
Ok, I finally make it work. Thanks Mark Baker. Here is the solution I used.
I just added this to my PDO layer :
$dbh = new PDO('mysql:charset=utf8mb4');
There are also 2 other ways to do it, read further here : UTF-8 all the way through
来源:https://stackoverflow.com/questions/31382524/all-is-on-utf8-but-i-still-got-strange-char-like