tags:

views:

48

answers:

1

I've asked this question before, here, however that solution didn't fix it when I looked closely. This is the problem.

For some reason, my mysql table is converting single and double quotes into strange characters. E.g

"aha"

is changed into:

“aha”

How can I fix this, or detect this in PHP and decode everything??

Previously i tried doing this query right after connecting to MySQL:

$sql="SET NAMES 'latin1'";
mysql_query($sql);

But that no longer has any effect. I'm seeing strings such as:

 “aha” (for "aha")
It’s (for "its")

etc.

Any ideas?

A: 

As per the answer to your original question, your input is actually in UTF-8, but the output you're seeing looks wrong because your output terminal and/or browser is set to the (single byte) character encoding "Windows 1252".

If you just make sure that your output is also set to UTF-8 then everything should be fine.

See http://stackoverflow.com/questions/760113/quotation-marks-turn-to-question-marks

Alnitak
Genius. Adding <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> below the <html> tag fixed it.
Click Upvote
great, glad it helped. I wish I knew why someone else down-voted it, though :(
Alnitak