Website & server configuration for UTF-8

By | June 28, 2014

Today, i have faced an encoding problem with my website. I’ve configured my server to work in UTF-8 but my website continue to display some strange characters. So this is the procedure that i’ve used to solve the problem.

I work on wanpserver :

  • In your php.ini
    default_charset = "utf-8".
  • In your my.ini, add this lines :
    #Mise en UTF-8
    character-set-server = utf8
    collation-server = utf8_general_ci
  • In your html file don’t forget to add doctype and META information:
    <!DOCTYPE html>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  • Set encoding of your table via PHPMYADMIN to : utf_general_ci: You may have to delete and save your data to reflect change.

Restart your server, and all gonna be ok.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.