William Boman
William Boman

Reputation: 2227

Question marks when outputting data from database

I have set charset to utf-8 everwhere in my database, in all tables and columns. It still won't display properly and question marks appears where non-latin letters appear. Is there something else that needs to be done or have I just forgotten something?

Upvotes: 1

Views: 2276

Answers (3)

Sajjad Asaad
Sajjad Asaad

Reputation: 71

Set charset to UTF-8 in your PDO connection like this:

"mysql:host=localhost;dbname=mydbname;charset=utf8,username,password"

Upvotes: 1

Mehrnaz Fattahi
Mehrnaz Fattahi

Reputation: 1

This worked for me.

mysql_set_charset('utf8',$mysql);

Upvotes: 0

William Boman
William Boman

Reputation: 2227

Well, I fixed it by changing the format on all my PHP-files to ANSI in Notepad++ and then adding <meta charset="ISO-8859-1"> into my header. Doesn't feel like a legit fix though.

Upvotes: 0

Related Questions