http://www.fusioncharts.com/Docs/Contents/SpChar.html
|
|
FusionCharts allows you to use multi-lingual (UTF-8) characters on the charts. Shown below is an example where we've used Arabic names on the chart:
|
|
You can use multi-lingual characters in all the charts in FusionCharts v3 suite.
FusionCharts supports only left-to-right languages as of now. It doesn't have native support for right-to-left languages like Hebrew. So, if you want to use Hebrew with FusionCharts, you'll have to programatically change the text sequence and then provide the data to FusionCharts.
|
|
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 begining of the file. It is an indicator that the file is containing UTF-8 encoded strings. |
|
WARNING : Do not rely on specifying the encoding setting i.e. <?xml version="1.0" encoding="UTF-8"?> in the XML header region. This does not add the Byte Order Mark (BOM) to the XML file. |
|
Please note that without the BOM stamp the chart would produce gibberish characters. Please compare the images below: |
|
Standard (with BOM) |
Gibberish (without BOM) |
|
|
|
|
|
|
For the XML files which are generated one-time and remains static, you can manually insert a BOM mark. This method is applicable when data is retrieved from file using the dataURL method. All you have to do is make sure the file containing the XML data contains a BOM mark or specify one if it is absent. In order to specify a BOM mark, follow these steps:
- Open the file in question in a text-editor that supports UTF-8 encoding with BOM stamp (Example – Windows Notepad).
- Open the save menu and specify file name, file type, encoding and BOM mark (if the option is available).
- Save the file.
|
|
The image below shows how this can be done in Windows Notepad. |
|
|
The image below shows how this can be done in Dreamweaver for mac. |
|
|
|
Ideally, in most of the cases you would NOT use a physical data file. Instead you'll have your own server side scripts virtually relay the XML data document to the chart. Thus this would come outside the scope of manual maintenance. Rather, you must write some code in the server side script to add the BOM stamp. The method is best practised when UTF-8 encoded strings are retrieved from databases and smilar locations. The implementation can be done using either of the two methods:
-
Manually add BOM to the XML realyer script file - just like adding BOM stamp to the static XML files you can also add the BOM stamp to the server side file which would be realying the dynamically generaeted XML. This needs to be done when the script file is created for the first time before you start coding in it.
-
Write BOM using script - In most cases the XML relayer script file might be created with ANSI encoded format. In this case, one needs to add the BOM using script at the very begining of the output stream. Moreover, when a server side script creates an XML file, it should add the BOM stamp as the very first 3 bytes of the file.
|
We list below techniques to implement BOM stamp using major server side technologies. |
|
Using ASP.NET C# |
|
Response.ContentType = "text/xml; characterset=utf-8" ; Response.BinaryWrite( new byte[] { 0xEF, 0xBB, 0xBF } );
|
|
Using ASP.NET VB |
|
Response.ContentType = "text/xml" Dim UTFHeader() As Byte = {&HEF, &HBB, &HBF} Response.BinaryWrite(UTFHeader)
|
|
Using PHP |
|
header ( 'Content-type: text/xml' ); echo pack ( "C3" , 0xef, 0xbb, 0xbf );
|
|
Using ASP |
|
Response.ContentType = "text/html" Response.AddHeader "Content-Type", "text/html;charset=UTF-8" Response.CodePage = 65001 Response.CharSet = "UTF-8"
Response.BinaryWrite( chrb(239) ) Response.BinaryWrite( chrb(187) ) Response.BinaryWrite( chrb(191) )
'
|
|
Using JSP |
|
response.setContentType( "text/xml; charset=UTF-8" ); OutputStream outs = response.getOutputStream(); outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} ); outs.flush();
|
|
Using ColdFusion |
|
context = getPageContext(); response = context.getResponse().getResponse(); out = response.getOutputStream();
out.write(239); out.write(187); out.write(191);
|
|
Using ROR |
|
utf8_arr = [0xEF,0xBB,0xBF] utf8_str = utf8_arr.pack("c3")
|
|
|
In many cases you might need to put the XML in the HTML/application file itself. We call this as dataXML method. Just like adding BOM stamp to a static XML files, in this case too you would need to save the file containing the chart SWF and XML with BOM stamp. This needs to be done when the script/HTML file is created for the first time before you start coding in it. |
|
Using Multi-lingual text in FusionCharts
FusionCharts allows you to use multi-lingual (UTF-8) characters on the charts. Shown below is an example where we've used Arabic names on the chart:
You can use multi-lingual characters in all the charts in FusionCharts v3 suite.
FusionCharts supports only left-to-right languages as of now. It doesn't have native support for right-to-left languages like Hebrew. So, if you want to use Hebrew with FusionCharts, you'll have to programatically change the text sequence and then provide the data to FusionCharts.
How to use multi-lingual characters?
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 :
1.for dataURL method - the XML file/stream should be having the BOM stamp and
2.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 begining of the file. It is an indicator that the file is containing UTF-8 encoded strings.
WARNING : Do not rely on specifying the encoding setting i.e. <?xml version="1.0" encoding="UTF-8"?> in the XML header region. This does not add the Byte Order Mark (BOM) to the XML file.
Please note that without the BOM stamp the chart would produce gibberish characters. Please compare the images below:
Standard (with BOM) Gibberish (without BOM)
How to add BOM ?
1. In static XML
For the XML files which are generated one-time and remains static, you can manually insert a BOM mark. This method is applicable when data is retrieved from file using the dataURL method. All you have to do is make sure the file containing the XML data contains a BOM mark or specify one if it is absent. In order to specify a BOM mark, follow these steps:
1.Open the file in question in a text-editor that supports UTF-8 encoding with BOM stamp (Example – Windows Notepad).
2.Open the save menu and specify file name, file type, encoding and BOM mark (if the option is available).
3.Save the file.
The image below shows how this can be done in Windows Notepad.
The image below shows how this can be done in Dreamweaver for mac.
2. In dynamically generated XML using server-side script
Ideally, in most of the cases you would NOT use a physical data file. Instead you'll have your own server side scripts virtually relay the XML data document to the chart. Thus this would come outside the scope of manual maintenance. Rather, you must write some code in the server side script to add the BOM stamp. The method is best practised when UTF-8 encoded strings are retrieved from databases and smilar locations. The implementation can be done using either of the two methods:
1.Manually add BOM to the XML realyer script file - just like adding BOM stamp to the static XML files you can also add the BOM stamp to the server side file which would be realying the dynamically generaeted XML. This needs to be done when the script file is created for the first time before you start coding in it.
2.Write BOM using script - In most cases the XML relayer script file might be created with ANSI encoded format. In this case, one needs to add the BOM using script at the very begining of the output stream. Moreover, when a server side script creates an XML file, it should add the BOM stamp as the very first 3 bytes of the file.
We list below techniques to implement BOM stamp using major server side technologies.
Using ASP.NET C#
Response.ContentType = "text/xml; characterset=utf-8" ;
Response.BinaryWrite( new byte[] { 0xEF, 0xBB, 0xBF } );
// Now write your XML data to output stream
Using ASP.NET VB
Response.ContentType = "text/xml"
Dim UTFHeader() As Byte = {&HEF, &HBB, &HBF}
Response.BinaryWrite(UTFHeader)
' Now write your XML data to output stream
Using PHP
header ( 'Content-type: text/xml' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );
// Now write your XML data to output stream
Using ASP
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
Response.BinaryWrite( chrb(239) )
Response.BinaryWrite( chrb(187) )
Response.BinaryWrite( chrb(191) )
' Now write your XML data to output stream
Using JSP
response.setContentType( "text/xml; charset=UTF-8" );
OutputStream outs = response.getOutputStream();
outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} );
outs.flush();
// Now write your XML data to output stream
Using ColdFusion
context = getPageContext();
response = context.getResponse().getResponse();
out = response.getOutputStream();
out.write(239);
out.write(187);
out.write(191);
// Now write your XML data to output stream
Using ROR
utf8_arr = [0xEF,0xBB,0xBF]
utf8_str = utf8_arr.pack("c3")
# Now write your XML data to output stream
3. While using dataXML method
In many cases you might need to put the XML in the HTML/application file itself. We call this as dataXML method. Just like adding BOM stamp to a static XML files, in this case too you would need to save the file containing the chart SWF and XML with BOM stamp. This needs to be done when the script/HTML file is created for the first time before you start coding in it.
分享到:
相关推荐
Cross-Lingual Word Embeddings by Anders Søgaard,Ivan Vulić,Sebastian Ruder,Manaal Faruqui
Cross-lingual Entity Linking (XEL) aims to ground entity mentions written in any language to an English Knowledge Base (KB), such as Wikipedia. XEL for most languages is challenging, owing to ...
根据 ARR 11 月份的投稿情况,我们可以看到,Multi-X 研究热潮、マulti-Modal、Multi-lingual 和 Multi-task 等领域正在蓬勃发展。此外,Prompt Learning 也是当前 NLP 界的热点之一, sell萌屋团队对该领域保持了...
【标题】"Multi-lingual E-Commerce System-开源"所指的是一款基于PHP开发的电子商务平台,其核心特点是支持多种语言和货币,这使得它能够适应全球化市场的需求。这样的系统通常采用模块化设计,方便扩展和定制,以...
Cross-lingual-KG-Building-2017-张鹏
标题中的“Multi-lingual vocabulary system-开源”指的是一个开源的多语言词汇学习系统,它专为GNU Emacs设计。GNU Emacs是一款广泛使用的、高度可定制的文本编辑器,具有丰富的功能,尤其受到程序员和高级用户的...
本文主要探讨了零触发跨语言机器阅读理解(Zero-Shot Cross-Lingual Machine Reading Comprehension, ZSLMRC)的任务,这是一种无需在目标语言上进行训练,直接利用源语言知识解决其他语言阅读理解问题的方法。...
跨平台应用程序旨在帮助用户从任何外语学习词汇。 添加/编辑/删除vocab单词(带有翻译,类别,句子,注释,图片)。 复习(测验)词汇。
知识图谱是当前信息技术领域的重要组成部分,用于结构化地组织和表示世界知识,包括实体(如人、地点、事件)及其之间的关系。跨语言知识图谱构建是这一领域的热点研究,旨在克服语言障碍,实现不同语言间知识的共享...
It offers key features like multi-lingual keyword searching, faceted search, intelligent matching, and relevancy weighting right out of the box. Solr in Action is the definitive guide to implementing...
在自然语言处理(NLP)领域,跨语言技术一直是研究者们关注的重点,它对于促进全球范围内的信息交流和知识共享具有重要意义。其中,双语词汇诱导作为实现语言之间翻译的一种有效手段,吸引了广泛关注。...
It offers key features like multi-lingual keyword searching, faceted search, intelligent matching, and relevancy weighting right out of the box. Solr in Action is the definitive guide to implementing...
我们比较每种事件的每种语言的网络,然后确定最长的社区语言能力英语德语西班牙语葡萄牙语斯洛文尼亚怎么跑# clone the repositorygit clone https://github.com/cleopatra-itn/TIME.gitcd Mono-lingual-Analysis
MLT (Multi-Lingual Text):** - **基础:** 自然场景多语言文本。 - **挑战任务:** 包括多语言场景文本检测和脚本识别。 - **应用场景:** 多语言环境下的场景文本识别。 - **数据集规模:** 训练集包含7,200张图片,...
MT / IE:跨语言开放式IE ... 要开始对此数据集进行训练,只需运行: ./run.sh评估经过一段时间的训练,您可以通过以下方式开始评估: python -m mt_ie --do_decode=True 注意:为方便起见,包含了multi-bleu.perl。
As business becomes more and more global, software developers increasingly need to make applications multi-lingual and culturally aware. The .NET Framework may well have the most comprehensive support...
《The-Lingual-App: 语言应用》 在当今全球化的时代,语言学习成为连接世界的桥梁,而科技的进步使得这一过程变得更加便捷高效。我们的Yomari代码营项目旨在利用Java编程语言,开发一款名为"The Lingual App"的语言...
跨语言检索分析主题建模对英语-西班牙语跨语言信息检索系统的影响。 在以前的研究中尚不清楚主题模型是否可以改善IR任务,但我的目标是将其集成到用于英语-西班牙语的CLIR中,并将其用作通过从每篇文章中提取主题来...
在IT领域,多语言数据集统计是至关重要的一个环节,特别是在机器学习、自然语言处理(NLP)和人工智能(AI)的应用中。标题中的“multilingual-data-stats”指的是一个专门针对多语言数据集进行统计分析的项目或工具...