Database Encoding - German Characters

Asked

Viewed 40 times

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 defined as utf8_general_ci

If you enter the data in a query directly in the database, it accepts these special characters, if you insert it through a query in php they are the way mentioned above.

I’m using the class PDO to enter data.

What may be the cause of this problem?

1 answer

2

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

Make sure you use the same encoding everywhere:

Use

mysql_query ("SET NAMES 'utf8'");

To set the encoding to UTF-8
Make sure that the database encoding is UTF-8 (use Heidisql etc. to check)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.