Re: French characters

From: Date: Mon, 19 Oct 2009 16:42:43 +0000
Subject: Re: French characters
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-299055@lists.php.net to get a copy of this message
Don wrote: I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description d�taill�e
After the update:    Pas de description détaillée
It is an encoding problem. My Thunderbird is set to use UTF-8 by default so the first line (Before the update:) does not display the sentence properly. It contains ? marks where the French character should be. The second line on the other hand displays the way it should be (AFAIK remember from school :) . So change your html encoding to utf-8 and it should work <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Also ensure that your tables are utf8 and the mysql connection talks utf8 by adding running the query SET NAMES 'utf8' after creating the connection. Like so: $conn = mysql_connect($server,$username,$password); mysql_query("SET NAMES 'utf8'", $conn); mysql_select_db($database, $conn) This page has a few pointers about switching a MySQL database to UTF-8. Might be worth a quick look http://www.network-technologies.org/tiny.php?id=9 -- John

« previous php.general (#299055) next »