1

I am having a major issue with inserting french characters in my mySQL DB. The french charaters doesn't display properly in the mysql table. For example "Éducation" is displayed as "Éducation". I have set the encoding to utf8_unicode_ci. I have also tried the function htmlentities($string ,ENT_QUOTES, "UTF-8"). Can someone help me with this?

casperOne
  • 72,334
  • 18
  • 180
  • 242
Rider
  • 773
  • 1
  • 10
  • 16
  • the problem is the accents characters are not UTF-8 by default, they are iso-8859-1. how do you see the results from mysql ? (a terminal connect to mysql using mysql client ? a web page) – ajreal Feb 27 '12 at 17:51

3 Answers3

7

In the php:

header ('Content-type: text/html; charset=utf-8');

After connection:

mysql_set_charset("utf8");

Roberto
  • 510
  • 7
  • 15
2

Please check these:

  • Database encoding
  • Table encoding
  • Field encoding
  • Database connection encoding
  • PHP runtime encoding
  • .php and other files encoding
  • Header encoding (HTTP header and/or HTML )
Peter Kiss
  • 9,271
  • 2
  • 22
  • 38
0

first check the encoding of the table, then check the encoding of the insert.

Qian
  • 957
  • 6
  • 6