Re: French characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux