canotto

Special Character

Recommended Posts

Good evening,

 

I have a problem in display label in chart. I create a chart from a database and i ahve the space character like + and & character like %26. I try to put the bom in xml file but nothing.

 

The call for the chart is:

 

...

strXML = "<chart exportEnabled='1' bgColor='ffffff' showBorder='1' paletteColors='1c1c1c,5f5f5f,b2b2b2,333333,808080,dddddd' animation=' " & animateChart & "'>"

...

'Finally, close <chart> element

strXML = strXML & "</chart>"

'Create the chart - Pie 3D Chart with data from strXML

Call renderChart("../../FusionCharts/Pie3D.swf", "", strXML, "FactorySum", 988, 550, false, true)

 

 

Attach, the image of chart, all + are space in db and all %26 are & in db too.

 

Can you help me?

Thanks

Andrea

chart.pdf

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

You will have to encode the characters.

 

For '&', please use & and see if this helps.

 

And for space, you will have to replace + character with space while the XML data is formed.

 

Also, please share the complete XML data.

Share this post


Link to post
Share on other sites

Dear Bindhu,

 

thank for your relay but the problem is hard for me.

I try with Server.URLEncode and with the replace but didn't works.

 

The complete code are:

 

--Start code--

 

strXML = "<chart exportEnabled='1' bgColor='ffffff' showBorder='1' paletteColors='1c1c1c,5f5f5f,b2b2b2,333333,808080,dddddd' animation=' " & animateChart & "'>"

 

strQuery = "select * from sov_all where ..."

Set oRs = oConn.Execute(strQuery)

While Not contatore = 40

svar = ors("nome_tbl_firm")

strXML = strXML & "<set label='" & Server.URLEncode(sVar) & "' value='" & ors("conteggiodistudio") & "' link='n-" & Server.URLEncode("lowfirmprofile_adv.asp?studio=" & ors("studio") & "&periodo=" & periodo) & "'/>"

end if

 

'Close recordset

contatore = contatore + 1

oRs.MoveNext

Wend

 

strXML = strXML & "</chart>"

 

Call renderChart("../../FusionCharts/Pie3D.swf", "", strXML, "FactorySum", 988, 550, false, true)

 

-- end code --

 

Thanks for your patience

 

Andrea

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

From the code, it seems the special characters like: <space> and '&' are coming from your database while generating the XML string in your server side script.

 

In most cases the XML generator Server-side script file might be created with ANSI encoded format.So you need to add the BOM using script at the very beginning of the output stream. Moreover, when a Server-side script creates an XML file, it should add the BOM stamp as the very first three bytes of the file.

 

So, could you please try once by putting the below code snippet at the very beginning of your ASP file?

 

Ref. Code:

Response.AddHeader "Content-Type", "text/xml;charset=UTF-8"
Response.CodePage = 65001"

Response.BinaryWrite( chrb(239) )
Response.BinaryWrite( chrb(187) )
Response.BinaryWrite( chrb(191) )

// Now write your XML data to output stream

 

For more information on "Using Multi-lingual text in FusionCharts XT", please follow the link below:

http://docs.fusioncharts.com/charts/contents/?advanced/special-chars/SpChar.html

 

Hope this helps!

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