-1

I have problems decoding several Chars.

In the Database, the Chars Ä, Ö and Ü are saved like "ö" or "�"

Any Idea how i can decode those Chars back to ÄÖÜ?

Styler2go
  • 604
  • 2
  • 12
  • 32
  • Have you controlled that you have utf8 on everything. – Rond Mar 24 '12 at 12:24
  • Yes. I made the following things for UTF-8: PHP: `header("Content-Type: text/html; charset=utf-8");` HTML: `` MySQL: `mysql_query("SET NAMES utf8") ;` – Styler2go Mar 24 '12 at 12:24
  • your data transition occurs from where t owhere. I mean, you are inserting using PHP interface? – hjpotter92 Mar 24 '12 at 12:25
  • Make sure that your database table is set to use a supporting character set (I'd suggest utf8-bin). – Ian Wood Mar 24 '12 at 12:27
  • Made that to everything.. Still not working. The data in the Database is coming from an IRC-Bot. Could that be the Problem? – Styler2go Mar 24 '12 at 12:36
  • Possible that IRC pass wrong charset so you need to encode/decode. – Rond Mar 24 '12 at 14:49
  • Start by reading this: http://www.joelonsoftware.com/articles/Unicode.html After that, make sure your database and all of your output is set to unicode. Make sure existing fields are modified to use utf-8 collations too. When everything is allright, you may assume that existing data is corrupted. Try to insert new data and see if it works. If so, you may try to attempt to correct any corruption in the old data. – GolezTrol Mar 24 '12 at 16:38

1 Answers1

0

If i remeber correctly you have to change dóthe data type to BLOB first, then you can reset the data type to VARCHAR or something similar with UTF8 encoding. Remember: the database, the table and all of the columns collation have to be UTF8 and even the connection to the database and the output encoding (for example as HTML output the charset header).

Peter Kiss
  • 9,309
  • 2
  • 23
  • 38