Si comme tous les développeurs qui doivent jouer avec les langues accentués sur des environments hétérogènes, vous avez certainement été confronté aux problèmes d'accents.
Voici les étapes:
1) Enregistrer vos fichier avec l'encoding UTF8 (si vous n'avez pas l'option, utiliser gedit ou notepad++)
2) S'assurer que les colonnes de votre BD sont en UTF8 et que le data de votre BD est en UTF8
Ceci est l'étape la plus compliqué, il y a beaucoup de tutoriels disponibles:
www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html
3) Au debut de votre code php ajouter:
header('Content-type: text/html; charset=UTF-8') ;
4) Au debut de votre code html ajouter:
<meta http-equiv="Content-type" value="text/html; charset=UTF-8" />
5) Dans httpd.conf
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8
6) dans php.ini
default_charset = "utf-8"
7) dans php.ini si vous utilisez mb_string
mbstring.language = Neutral ; Set default language to Neutral(UTF-8) (default)
mbstring.internal_encoding = UTF-8 ; Set default internal encoding to UTF-8
mbstring.encoding_translation = On ; HTTP input encoding translation is enabled
mbstring.http_input = auto ; Set HTTP input character set dectection to auto
mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8
mbstring.detect_order = auto ; Set default character encoding detection order to auto
mbstring.substitute_character = none ; Do not print invalid characters
default_charset = UTF-8 ; Default character set for auto content type header
8) dans my.cnf
character-set-server=utf8
default-collation=utf8_unicode_ci
9) Après la connexion à la BD en php, executer la commande SQL:
SET NAMES 'utf8';





