Sign in to follow this  
oaom

FusionCharts v3 Evaluation and UTF-8 Problem

Recommended Posts

Hello,

 

 

 

I have gone through your documentation thoroughly and have been evaluating your product for quite some time now. It is very impressive, even though I have not been able to correctly display multilingual characters. We are working on a multi-language application, and an example language we support would be Turkish. Unfortunately, the characters do not display correctly even after Iwe made sure of the following:

 

 

 

1. The xml tag contains (utf8 in its xml.inspect! output)

<?xml version="1.0" encoding="UTF-8"?>

 

2. Our RoR application runs with en-EN.UTF8 ENV variable set.

 

3. Our database has all of its tables and default collation in utf8.

 

4. We are using the supplied dataURL method.

 

5. Our XML output is correctly displayed on Firefox as (notice the multi-lingual characters):

 

 

 

 

 

 

 

 

 

 

 

 

 

Edited by Guest

Share this post


Link to post
Share on other sites

Also, here is what the xml output shows (notice that all non-English characters are correctly replaced with their UTF-8 equivalents):

 

 

 

<?xml version="1.0" encoding="utf-8"?>

Share this post


Link to post
Share on other sites

I have tried adding 0xEF, 0xBB, 0xBF at the beginning of the xml string that is generated; which really made the output look like:

 

 

 

239187191

<?xml version="1.0" encoding="utf-8"?>

 

 

 

I'm still having the same problem though.

 

 

 

Best,

 

OA

Share this post


Link to post
Share on other sites

yeah, please do share with us.

 

 

 

I have the same issues. Looking at the response xml returned in firefox, i can see the Japaneses and the Chinese characters just fine. (our .net application supports displaying characters of all kinds)

 

 

 

However, the x label names are messed up. Not sure what to do with it.

 

I constructed an xml file manually, in visual studio, saved the file as UTF-8 (however, the only option VS 2005 gave me was "Unicode (UTF-8 with signature) - Codepage 65001, Line endings: Unicode Line Separator (LS)".

 

 

 

Tried with Notepad++ , opened up the xml, I can see the non-English characters just fine as well.

 

 

 

Still no joy. :( but other than that, i'm enjoying it so much. :)

 

 

 

EDIT - resolved. The way I manually constructed the xml and back to the javascript setDataURL was wrong. It didn't have BOM in front.

Edited by Guest

Share this post


Link to post
Share on other sites

Even if the response is late, I thought I should mention the solution for this, for the benefit of all. 

Apart from the steps you have taken,the Byte Order Mark for UTF8 should be put in the xml that is being supplied to FusionCharts.

In the chart provider view, (say, pie_chart.html.erb)

<%
utf8_arr=[0xEF,0xBB,0xBF]
utf8_str = utf8_arr.pack("c3")
str_xml=utf8_str
str_xml+="<?xml version='1.0' encoding='UTF-8'?>"
str_xml +="<graph caption... >"
# add data here
str_xml+="</graph>"
%>
<%=str_xml%>

also, it is better to construct the xml in the .html.erb file than to use a Builder.

Share this post


Link to post
Share on other sites

Hi, I am also evaluating one of the products, fusion widgets. I wonder if you were able to resolve this issue? Hopefully one of the Fusion Charts team members respond to this inquiry.

 

 

 

Appreciate the info.

Share this post


Link to post
Share on other sites

I have not been able to see your code. Here are some guidelines.

Please output the UTF-8 BOM before writing the xml like this:

<% 
utf8_arr=[0xEF,0xBB,0xBF]
utf8_str = utf8_arr.pack("c3")
str_xml = utf8_str 
str_xml +="<?xml version='1.0' encoding='UTF-8'?>"
str_xml +="<chart ...>"
str_xml += "<set ...>"
str_xml+="</chart>"
#Output the xml 
%><%=str_xml%>

Also, it is better not to use the Builder for generating the xml.

Hope this helps.

Srividya

Share this post


Link to post
Share on other sites

I was not able to view your code, but here are a few guidelines.

Please output the UTF-8 BOM before outputting the xml as shown:

<% 
 utf8_arr=[0xEF,0xBB,0xBF]
 utf8_str = utf8_arr.pack("c3")
str_xml = utf8_str 
 str_xml +="<?xml version='1.0' encoding='UTF-8'?>"
 str_xml +="<chart...>"
 str_xml += "<set .../>"
 str_xml+="</chart>"
 #Output the xml
 %><%=str_xml%>

Also, please do not use the builder to build the xml.

Hope this works for you.

Srividya

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this