Hi Folk
Here I am writing my first php / mysql site, almost ready, and now this... charactersets.. ..
The encoding that I use on my webpage is:
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
When people enter new data I use
$newvalue = htmlentities($_ POST["newvalue"], ENT_QUOTES)
I then SQL this into my table and next I display the value
e.g. <DIV CLASS="content" >'.$newvalue. '</DIV>
All of this works fine, BUT, funny characters that may have been entered through the form (e.g. Word-Style quotation marks,
e-accent-grave, etc..) are taking on a whole new life. I put in an e with an accent and it changed into a chinese character.
I tried to run
$link = mysql_connect($ host, $username, $password);
$charset = mysql_character _set_name($link );
printf ("character set is %s\n", $charset);
but that only gave me an error.
I searched on google, but many of the notes are in other languages.... ;-)
Does anyone have any hints in English?
TIA
- Nicolaas
Here I am writing my first php / mysql site, almost ready, and now this... charactersets.. ..
The encoding that I use on my webpage is:
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
When people enter new data I use
$newvalue = htmlentities($_ POST["newvalue"], ENT_QUOTES)
I then SQL this into my table and next I display the value
e.g. <DIV CLASS="content" >'.$newvalue. '</DIV>
All of this works fine, BUT, funny characters that may have been entered through the form (e.g. Word-Style quotation marks,
e-accent-grave, etc..) are taking on a whole new life. I put in an e with an accent and it changed into a chinese character.
I tried to run
$link = mysql_connect($ host, $username, $password);
$charset = mysql_character _set_name($link );
printf ("character set is %s\n", $charset);
but that only gave me an error.
I searched on google, but many of the notes are in other languages.... ;-)
Does anyone have any hints in English?
TIA
- Nicolaas
Comment