Pound sign

Dec 2, 2010 at 11:35 AM

Hi,

I've the following code with my table creation:

$row->nextCell()->setWidth($colWidth)->createTextRun($text)->getFont()->setSize($cell_fontsize);

$text contains a '£' character and it creates the ppt fine but I cannot open it via powerpoint viewer.  When I open to edit it, the data for that row is empty but contains a '[' character for some reason.  $ seems to work without an issue.

Regards
Steve

Coordinator
Dec 2, 2010 at 8:27 PM

Ensure that you're the using UTF-8 codepoint for the £ sign rather than the ISO-8859-1 Latin1 codepoint

Dec 3, 2010 at 8:11 AM

Thanks for the pointer, I did the following:

$text = utf8_encode($text);

$row->nextCell()->setWidth($colWidth)->createTextRun($text)->getFont()->setSize($cell_fontsize);

And now it works a treat.

Steve