Crayl
Crayl

Reputation: 1911

MySQL UTF8 Problem

I have a strange UTF8 encoding problem, which I don't understand. If a friend of mine fills out a form on my webpage, then all german "umlauts" (ä,ü,ö) are displayed in strange chars in my database. When I do the same, they are displayed normally, how it should be. Everything is set to utf8_general_ci, so it should work. But it doesn't, when my friend fills out the form.

Has anyone a suggestion for me?

Thanks!

Upvotes: 0

Views: 556

Answers (3)

Edson Medina
Edson Medina

Reputation: 10289

Run SET NAMES utf8 on mysql right after connection

Upvotes: 0

Stepan Vihor
Stepan Vihor

Reputation: 1070

You haven't specified the language you write your app in, and it seems to be connection-based problem. You must manually set connection encoding, f.g. in JDBC, by appending on the end of connection string "?characterEncoding=utf8"

Upvotes: 2

Viktor
Viktor

Reputation: 3536

Even though all tables are UTF-8, the database connection might be using latin-1. What output do you get with SHOW VARIABLES LIKE '%character%'; in MySQL? Any signs of latin-1 there? If so, adjust your charset settings in the MySQL configuration file.

Upvotes: 2

Related Questions