Ali
Ali

Reputation: 267077

MySQL encoding issue

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??

Upvotes: 0

Views: 210

Answers (2)

Gumbo
Gumbo

Reputation: 655239

It seems that the UTF-8 encoded string “aha” (binary 0xE2809C 0x61 0x68 0x61 0xE2809D) is interpreted with Windows-1252. There this byte sequence represents the character sequence “ahaâ€.

Upvotes: 0

soulmerge
soulmerge

Reputation: 75704

The encoding of your mysql client and your server don't match. Use SET NAMES to match the character set of the connection to the one used in your PHP files.

Upvotes: 1

Related Questions