0

I'm storing UTF8 in my database and this all works properly but whenever I retrieve data from the database I get these weird symbols,

Example: becomes â„¢

When I make a connection the DB I use array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")

Am I missing something?

Martin Dev
  • 67
  • 2
  • 8
  • Try changing that to: `1002 => 'SET NAMES utf8'` (this is a known bug in PDO). Also, make sure that both the PHP-file is stored as UTF-8, and that you are using UTF-8 in the database. – junkfoodjunkie May 25 '17 at 17:02
  • @junkfoodjunkie how do I 'store' a php file as UTF-8? I'm using UTF-8 in the database for sure. EDIT: Changing it to 1002 didn't work. – Martin Dev May 25 '17 at 17:24
  • @junkfoodjunkie well, I added the charset which worked. Thanks. – Martin Dev May 25 '17 at 17:33

0 Answers0