Sign in to follow this  
Rahul Kumar

FlashVars - dataURL - XML / Classic ASP & Encoding

Recommended Posts

Hi,

We have a chart which displays Chinese characters.

The following pseudo code displays the chinese characters correctly:

strDataURL = test.xml (saved as utf-8 with utf-8 encoding specified in file).
<PARAM NAME="FlashVars" value="&dataURL=<%=strDataURL%>"> 

The following pseudo code does not display the chinese characters correctly:

strDataURL = test.asp (saved as utf-8, with utf-8 charset specified via response object, and retrieves xml/characters from database (hardcoded below))
<PARAM NAME="FlashVars" value="&dataURL=<%=strDataURL%>"> 

Example ASP (hardcoded) file content:

<%@ Language=VBScript %>
<%response.charset = "utf-8" %>
<?xml version="1.0" encoding="UTF-8" ?> 
<chart bgcolor="DCEBDE" formatNumberScale="0" decimalPrecision="1" showPercentageValues="0" showNames="1" numberPrefix="" showValues="1" showPercentageInLabel="1" pieYScale="45" pieBorderAlpha="40" pieFillAlpha="70" pieSliceDepth="15" pieRadius="100" animation="1">
<set value="64455" name="???" color="005137" /> 
<set value="-64455" name="??" color="00CC8A" isSliced="1" /> 
</chart>

I've searched the forums and I noticed a majority of responses point to the "BOM"; could this be the case here where there is probably no BOM mark when delivered from classic ASP? Is the above code possible? I have workarounds but this is eating me...

As well, on the site where this ASP page resides we have code which detects the language settings of the browser; all requests sent by all chart .swf files are sent in EN, is there a way to overide this?

Best Regards, D.

Share this post


Link to post
Share on other sites

Hi,

 

Could you please try using the following code:

<%@ Language=VBScript %>

<%

Response.ContentType = "text/xml"

Response.CharSet = "UTF-8"

'Addition of BOM characters

Response.BinaryWrite(chrb(239))

Response.BinaryWrite(chrb(187))

Response.BinaryWrite(chrb(191))

%>

<chart bgcolor="DCEBDE" formatNumberScale="0" decimalPrecision="1" showPercentageValues="0" showNames="1" numberPrefix="" showValues="1" showPercentageInLabel="1" pieYScale="45" pieBorderAlpha="40" pieFillAlpha="70" pieSliceDepth="15" pieRadius="100" animation="1">

<set value="64455" name="???" color="005137" />

<set value="-64455" name="??" color="00CC8A" isSliced="1" />

</chart>

Edited by Guest

Share this post


Link to post
Share on other sites

You confirmed it.

Thanks mate!

Solution (classic asp):

UTF-8 Header and

response.binarywrite chrb(239) & chrb(187) & chrb(191)

response.write strXMLData

[code]

Best Regards,

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