When creating forms with french content, I got strange characters in my database.
The solution was to put some utf-8 declaration at the top of the php pages and to add some extra code for mysql.


php header(‘content-type: text/html; charset: utf-8’);
mb_internal_encoding( ‘UTF-8’ );

add the following code after you make a connection and before you run a query
mysql_query(“SET NAMES ‘utf8′”);
mysql_query(“SET CHARACTER SET utf8″);

Additionally you could also add accept-charset=”utf-8” to your form tags.

Leave a Reply

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