mysql utf32 unicode ci and html charset utf 8 used but character appear

mysql utf32 unicode ci and html charset utf 8 used but character appear  using -'mysql,html,encoding'

I have some text in French in a MySQL field, which appears correctly under PHPMyAdmin:


The field is encoded as utf32_unicode_ci. (It is a varchar(500), utf32_unicode_ci).

but a call to a PHP script calling this parameter and outputing in html encoded in utf-8 returns:


Here is an extract of my php html header:

<html xmlns="" dir="ltr" lang="fr-FR">
<head profile="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

How can I fix this?

asked Oct 7, 2015 by badhwar.rohit
0 votes

1 Answer

0 votes

Please, besides the database encoding, be sure you check the following:

  • utf8 encoding of the FILES (js/php) (under ultra-edit, F12: save as UTF8-NOBOM)
  • utf8 html content:
  • utf8 of your db connection: SET character_set_connection = 'utf8'
  • utf8 of your query results: SET character_set_results = 'utf8'
  • utf8 of your db client: SET character_set_client = 'utf8'
  • utf8 of your mysql tables: ALTER TABLE table CONVERT TO CHARACTER SET utf8;
  • utf8 of your db server: SET character_set_database = 'utf8' and SET character_set_server = 'utf8'
  • in some cases, forcing utf8 in file is necessary when hardcoded values need encoding. You would need to add a comment on top of your file for instance, with charset=utf-8, so ultra edit or your favorite editor can detect it.


ps: I don't know utf32 but somehow the logic should be the same

answered Oct 7, 2015 by nikhilapatil