Sign in to follow this  
Gowrishankar

Japanese Language In Fusionchart

Recommended Posts

Hi,

Follwoing is the code I used for showing Japanese Chnaracters in Fusionchart. (My XML contains Japanese characters)

 

 

OutputStream out = response.getOutputStream();
outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} );
out.write(xmlDoc.getBytes());
out.flush();
out.close();

 

 

Also Tried follwoign one

PrintStream ps = new PrintStream(response.getOutputStream(), true, "UTF-8"); 
ps.print(new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF});
ps.println(xmlDoc);
ps.close();

 

 

for these 2 code the result is coming as the "pict1.jsp" chart.

 

Now I tried in stanalone HTML file using ASCII code for the japanese characters (amp;#24215;amp;#33303; is correspondind ASCII code for my Japanese character).

This gives me the "pict2.jsp" chart

 

In both the cases the actual japanese character is not showing.

 

please advice me further for fixing this issue.

post-24522-0-66157800-1323773189_thumb.jpg

post-24522-0-73135300-1323773202_thumb.jpg

Edited by Gowrishankar

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

To use multi-lingual characters on the chart, you necessarily need to use UTF-8 encoded XML. More importantly, the XML file/stream does require a BOM stamp to be present as the very first 3 Bytes of the file. Hence, one must remember the two basic thumb rules :

 

for dataURL method - the XML file/stream should be having the BOM stamp and

 

for dataXML method - the HTML/application file containing the XML as well as the chart SWF should have the BOM stamp.

 

What is BOM - Byte Order Mark. It is 'EF BB EF' - these 3 bytes in case of UTF-8 encoded files, the BOM being placed at the very beginning of the file. It is an indicator that the file is containing UTF-8 encoded strings.

 

For more details and sample example, please visit the links below:

 

http://docs.fusionch...ars/SpChar.html

 

http://docs.fusionch...TF8Example.html

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

After some try we got it working. below code works fine.

 

response.setContentType("text/xml; characterset=utf-8");
response.setCharacterEncoding("UTF-8");
OutputStream outs = response.getOutputStream();
outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} );


outs.write(xmlDoc.getBytes("UTF-8"));


outs.flush();

 

Apart from putting

outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} ); 

as mentioned in fusion code sample (thanks to Angshu for the link), need to mention "UTF-8" for the getBytes() method.

It worked fine after that.

Edited by Gowrishankar

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Glad to know that you have managed to resolve your problem.

 

Happy FusionCharting!!! biggrin.gif

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