Link to home
Create AccountLog in
Avatar of kishkool75
kishkool75

asked on

UTF8 problem

Hi,

I've got a problem with encoding.

I've got a website in : content="text/html; charset=utf-8"
In my DB my field is in : utf8_unicode_ci

I've got an XML with : <?xml version="1.0" encoding="UTF-8"?>

But every time that i update my DB with a value from XML i've got this result :

"BLANCHE éé MARIE"

instead of "BLANCHE éé MARIE"

Can you help me?
Avatar of Pratima
Pratima
Flag of India image

•Make sure you send the SET NAMES utf8 command to MySQL after connecting, before running any MySQL queries.
•Make sure your page is actually rendered as utf-8 (if there's an HTTP header Content-Type: text/html;charset=iso-8859-1, browsers disagree about which should win).
•Read this article: Handling Unicode Front To Back In A Web App .
If phpMyAdmin displays your entered data as correct Unicode text, then my bet is that you are not doing SET NAMES utf8 after connecting.


refer
http://stackoverflow.com/questions/10367133/utf-8-showing-correctly-in-database-however-not-in-html-despite-utf-8-charset
Avatar of kishkool75
kishkool75

ASKER

No, in my DB i also have : BLANCHE éé MARIE
By the way, i'm lauching this script from linux.

php script.php

If i try to update my DB with a test like "totoéé" i have in my DB "totoéé"
Even with mysql_query("set names 'utf8'"); like you advise me.
ASKER CERTIFIED SOLUTION
Avatar of kishkool75
kishkool75

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Because i found solution by myself