"\x1F"
will work for regular ASCII characters, but I think sigma is a unicode character, so you're going to have to use something like utf8_encode. PHP has poor Unicode support.
I could use chr(229) as well, where 229 is the ASCII code I'm looking for
You need to make sure you're sending the correct headers when outputting.
<?php
header('Content-Type: text/html; charset=utf-8');
$char = utf8_encode(html_entity_decode('σ'));
echo $char;
This will output the character.
Edit:
If passing the character into the graph doesn't work, then the software doesn't support UTF-8.
The sigma (σ) can be represented in UTF-8 encoding by the byte sequende xCF x83
(codepoint U+03C3), so you could try to build a PHP string
$sigma = "\xCF\x83";
But as I don't know FusionChart, I cannot say if it can handle UTF-8 encoded strings or multi-byte strings in general. According to their product description, they do support unicode (but require a UTF-8 BOM), so you can build the XML response in PHP:
$response = "\xEF\xBB\xEF<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<root>
<element attribute=\"\xCF\x83\">\xCF\x83</element>
</root>";
header('Content-Type: text/xml; charset=utf-8');
echo $response;
There is also a sigma (σ) character in ISO-8859-7 and Windows-1253 (xF3
) - but I doubt that this will help you.
Third option would be to specify some kind of mathematical symbol font that maps the sigma (σ) to some other character.
For FusionCharts, to show small sigma in the chart, please use %CF%83. Put this percentage encoded form in a php string. I have tried this. It works. Also check the documentation pages on using special characters here: http://www.fusioncharts.com/docs/Contents/SpChar_Euro.html http://www.fusioncharts.com/docs/Contents/SpChar_Pound.html etc.