kunal
kunal

Reputation: 49

how to deal with special characters in fusion charts while making xml through php

I am using fusion charts, and getting xml of fusion charts through ajax. On server side I am using php to make xml. I am using htmlentities function like this

$name = htmlentities($name, ENT_QUOTES , 'UTF-8'); 

to encode special characters and getting this kind of xml

<dataset seriesName='le fran&ccedil;ais'> 

for le français.

But is does not show in fusion chart. Plz tell me the correct way to do it.

Upvotes: 0

Views: 759

Answers (1)

J. Rahmati
J. Rahmati

Reputation: 783

I just made a PHP file with the lines below and save it as an ANSI encoded file:

$name = 'le français';
$name = htmlentities($name, ENT_QUOTES);
echo $name;

This just gave me the result you were expecting:

le fran&ccedil;ais

Seems the special charcter just gets ignored when using UTF-8 as encoding:

htmlentities($name, ENT_QUOTES, 'UTF-8');

Upvotes: 1

Related Questions