All is on UTF8 but I still got strange char like �

22,711

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

Share:
22,711
lio
Author by

lio

Updated on November 23, 2020

Comments

  • lio
    lio over 3 years

    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 ?