How to Inserting french characters in mySQL DB tab

2019-06-05 18:21发布

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?

标签: php mysql utf-8
3条回答
叼着烟拽天下
2楼-- · 2019-06-05 18:41

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 )
查看更多
放我归山
3楼-- · 2019-06-05 18:47

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

查看更多
做个烂人
4楼-- · 2019-06-05 18:59

In the php:

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

After connection:

mysql_set_charset("utf8");

查看更多
登录 后发表回答