this my first post and i want to thank everybody who'll open my post and try to figure what the problem is. So here we go :
I have an Intranet using PHP/AJAX/MySQL, so some parts are pure PHP, others AJAX etc... i'm sure you got the thing already, i have many INSERT or UPDATE sql statements from users input. Some are from news users put on the Intranet, or on many other parts of the Intranet.
All the testing phase (from my side) has been made with FF under Linux, this is my Development box, i tested the Intranet with IE7 and 8 and it's working fine, but i have to do a check in all my INSERT or UPDATE statement, that if it's IE browser do:
Code: Select all
$var = utf8_encode($var);I'm wondering, if any of you might have an idea on what the problem could be? For the moment, i've added the previous code to every important variables requiring correct encoding, but i want to find a way to fix the problem.
A little example for you :
Working with FF NOT working with IE
Code: Select all
header('Content-type: text/html; charset=utf-8');
$var = "Télévision";
$sql = "INSERT INTO tableX VALUES ('".$var."')";
Code: Select all
header('Content-type: text/html; charset=utf-8');
$var = "Télévision";
$var = utf8_encode($var);
$sql = "INSERT INTO tableX VALUES ('".$var."')";
Code: Select all
function isMSIE($agent)
{
if(eregi("MSIE",$agent))
return true;
else
return false;
}
Code: Select all
header('Content-type: text/html; charset=utf-8');
$var = "Télévision";
if(isMSIE($_SERVER['HTTP_USER_AGENT']) == true)
{
$var = utf8_encode($var);
}
$sql = "INSERT INTO tableX VALUES ('".$var."')";
thanks for your time!