Kuba Orlik
Kuba Orlik

Reputation: 3500

MySQL - some unicode chars get mangled

I'm using sending data to a web server using POST headers. When the data contains non-alphabetical character (like, for example, "Ą") it gets mangled (the data contains 'Ä„' instead of 'Ą'). I'm using utf8_unicode_ci collation on this table. How can I fix this?

Upvotes: 0

Views: 109

Answers (2)

Mike Brant
Mike Brant

Reputation: 71414

You need to use a unicode CHARSET (in addition to collation) on the specific field in the table as well, if the field was created while the table charset was something other than outf8 charset you want to use.

So check your field values for charset and collation. Charset determines the actual storage encoding, not collate. Collation relates to how the data is sorted. So if it is not being stored correctly, the problem is with charset, not collation.

See this link for more info

http://dev.mysql.com/doc/refman/5.0/en/charset-column.html

And here for specs on ALTER TABLE ... CONVERT TO CHARACTER SET syntax if you need to change the charset.

http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

Upvotes: 0

matt
matt

Reputation: 1983

Check the character encoding on your web server.

If you include what kind of web server it is, someone can tell you how to check the encoding.

Upvotes: 1

Related Questions