Gowrishankar Report post Posted December 13, 2011 (edited) 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. Edited December 13, 2011 by Gowrishankar Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 13, 2011 Hi, Welcome to FusionCharts Forum! 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
Gowrishankar Report post Posted December 13, 2011 Hi Angshu, Thanks for ur quick response. I didnt expect ur reply that fast (Still i was editing my post) Actually if you see the my first code sinpet i was using exactly the idea given in the url "http://docs.fusionch...ars/SpChar.html" you mentioned. But still it didnt work. Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 13, 2011 Hi, Thanks for your response. Please refer to the link: http://docs.fusioncharts.com/charts/?Code/J2EE/JSP_UTF8Example.html The above link has an example of using Japanese character with JSP. Hope this helps. Share this post Link to post Share on other sites
Gowrishankar Report post Posted December 13, 2011 Thanks Angshu for the example, will try it and let you konw. Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 13, 2011 Hi, Thanks for your response. Looking forward to your feedback. Share this post Link to post Share on other sites
Gowrishankar Report post Posted December 19, 2011 (edited) 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 December 19, 2011 by Gowrishankar Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 19, 2011 Hi, Glad to know that you have managed to resolve your problem. Happy FusionCharting!!! Share this post Link to post Share on other sites