+1  A: 

What about:

html_entity_decode('σ');

PHP Manual for html_entity_decode

Paul Dixon
Tried it, but it output σ
Brian Ramsay
+1  A: 

"\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.

Eli
A: 

I could use chr(229) as well, where 229 is the ASCII code I'm looking for

Brian Ramsay
The Extended ASCII table I found was wrong. There is no sigma in ASCII
Brian Ramsay
+2  A: 

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('&sigma;'));

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.

Kieran Hall
I thought this was going to work. Unfortunately, I still get σ output, no matter how I manage to structure the header.
Brian Ramsay
According to FusionCharts documentation and example graphs, they do support Unicode
Brian Ramsay
I can get it output correctly to the browser using this answer, however I am clearly not specifying it correctly in setting up the xml for the chart.
Brian Ramsay
Yes, encoding can be a mine field, eh? My rule of thumb is to make everything UTF-8. Googling or just searching on this site will provide plenty of resources on that topic.
Kieran Hall
+2  A: 

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.

Stefan Gehrig
+1  A: 

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.

Srividya Sharma
+1  A: 

Hi Brian,

Save your .php file as utf-8 encode with bom enabled,and you can use directly a sigma character (σ).

    $sXML = "<chart><set value='20' label='σ' /></chart>";
echo renderChartHTML("../FusionCharts/Column2D.swf", "", "$sXML", "myFirst", 600, 300, false);