Database Encoding - German Characters

0

I come across a strange situation, when I try to insert German characters (ä, ä) into the database they are inserted as follows:

"üüü "

The field is set to utf8_general_ci

If you insert the data in a query directly into the database, it accepts these special characters, if you insert them through a query in php these are as previously mentioned.

I'm using the PDO class to enter data.

What could be the cause of this problem?

    
asked by anonymous 02.06.2016 / 17:21

1 answer

2

The stored data is encoded in UTF-8 (ü to an "O" is typical for UTF-8), but is not displayed as UTF-8, but rather as ISO-8859-1 or similar.

Make sure you use the same encoding everywhere:

Use

mysql_query ("SET NAMES 'utf8'");

To set the encoding for UTF-8
  Make sure the database encoding is UTF-8 (use HeidiSQL etc. to verify)

    
02.06.2016 / 17:35