Currently fusion charts uses the function fusioncharts_entities($string) to clean strings before inserting them into the XML. When it comes to special chars, this only works in some occassions. For example, the following conversions will happen:

1) Dégroupage => Dégroupage => D%26eacute;groupage
2) d'Equipement => d'Equipement => d%26#039;Equipement

Step one calls htmlentities(), step two replaces the ampersand (&). Now the problem is that for chart titles, we need to clean the string all the way (both steps). But for series titles, we need to stop after step 1, because the ampersand is needed.

My fix at the moment is to make another function which doesn't perform step 2 and call it as appropriate. Will submit patch when others are committed. Thanks!

CommentFileSizeAuthor
#2 entities.patch4.18 KBlarskleiner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron1234nz’s picture

I read a comment in the fusioncharts documentation this evening about adding BOM headers to the XML output. I'll experiment with this and see if I can get away without my encode characters function. http://www.fusioncharts.com/docs/Contents/SpChar.html

larskleiner’s picture

FileSize
4.18 KB

I think I got it to work.

I changed fusioncharts_entities to take a $section param. When the graph tag gets processed htmlentities($string, ENT_QUOTES, 'UTF-8') gets run but otherwise fusioncharts_entities only escapes custom characters.

jsmm’s picture

I have the same problem. I have read the link and your patch but don't know how to apply it. I have entered the data through the create content -fusioncharts type.

Could you please give detailed instructions?

Thanks,

larskleiner’s picture

Hi Jose,

my patch is outdated and doesn't seem to fix the problem in its entirety. You are probably better off experimenting with some character escape sequences yourself then applying my patch. The approach I took was pretty much trial and error, when FusionCharts failed on a particular character I added an escape sequence and re-tested until it failed over the next char and so on.

This never solved my issue completely though. The wider problem seems to be down to different character escape sequences in PHP, JavaScript, XML and Flash, differences I wasn't (and won't be) able to iron out. Once I got an escape sequence to work in JavaScript, it didn't work in XML or PHP or Flash. And even when I got it to work for a certain sequence it worked only on Firefox but not in Internet Explorer. In all, a very frustrating exercise, I gave up for the time being.

FusionCharts support also suggested to try adding the BOM which didn't help. It changed some escape sequences but it didn't narrow down the differences between PHP, JavaScript, XML and Flash.

If you want to carry on getting to the bottom of this issue I suggest you take the FusionCharts sample charts and embed them using this module and see where it starts to break.

aaron1234nz’s picture

Status: Active » Closed (duplicate)

Duplicate of #631744: German umlaute in chart titles are displayed as html entities. Patch has been applied to fix this.