Bernie6421

Chinese characters not displaying

Recommended Posts

Hi,

 

I use Fusion charts 3.1, I have the problem, that the chinese characters are not displayed correctly:

See the first chart here: http://www.factfish.org/zh/tonjiguo/%E5%BE%B7%E5%9B%BD/%E4%BA%BA%E5%9D%87%E8%83%BD%E6%BA%90%E6%B6%88%E8%80%97

 

What's strange is that the second chart on the Page (the Pie chart) displays the characters correctly.

The XML of the chart seems OK: All charcters are encoded as XML entities:

<chart caption='人均能源消耗 (千克油当量)' ...

You can take a look at the XML here: http://www.factfish.org/statistics/drill_down_line_chart.php?data_set=105&location=47〈=zh

 

In the PHP the Chart is created like this:

$xml_string = $doc->saveXML();
header('Content-Type: text/html; charset=utf-8');

$xml_string=str_replace('"',"'",$xml_string);
echo trim(preg_replace('/<\?xml.*\?>/', '', $xml_string, 1));

Any ideas?

 

Thank you

 

Bernhard

Edited by Bernie6421

Share this post


Link to post
Share on other sites

Hi Vishalika,

 

thank you very much for your response, I tried to add the BOM at the beginning of the file but it's still not working.

In my case I don't use the UTF8 characters directly as caption but the XML entities, so it should work also without UTF8 encoding (?).

Do you have another idea?

 

Thanks

 

Bernhard

Share this post


Link to post
Share on other sites

Hi,

 

Can you please specify how you are adding the BOM stamp?

 

Also, you necessarily need to use UTF-8 encoded XML for displaying multi-lingual characters in caption.

 

If possible, send a scaled down sample so that we can help you out further?

 

Awaiting response.

Share this post


Link to post
Share on other sites

Thank you for your answer, I used this code for adding the BOM stamp

header ( 'Content-type: text/xml; charset=utf-8' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );

Here is a narrowed version of the chart:

<chart caption='人均能源消耗 (千克油当量)'>
    <categories>
        <category label='1960'/>
        <category label='1961'/>
    </categories>
    <dataset seriesName='德国'>
        <set value='1952.53390446186' toolText='1960: 1.953'/>
        <set value='1994.3205580687' toolText='1961: 1.994'/>
    </dataset>
</chart>

Hope that can help you to track the problem,

 

Thanks

 

Bernhard

Edited by Bernie6421

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