Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #9062 Euro does not appear correctly in formula styles
Submitted: 2006-10-16 13:03 UTC
From: simon at elroble dot co dot uk Assigned: progi1984
Status: Closed Package: Spreadsheet_Excel_Writer (version 0.9.1)
PHP Version: 4.4.3 OS: Apache Webserver | Windows XL
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-16 13:03 UTC] simon at elroble dot co dot uk (Simon Tiplady)
Description: ------------ I can add the euro symbol to a worksheet as text field with no problem but when i use the euro symbol as part of a number format in a style the euro is encoded incorrectly. From past experience the Euro symobl may not appear correctly in this bug report, setNumFormat("#,##0.00 ¤"); The character between the 0.00 and the close quote should be a euro symbol Test script: --------------- <? include("Spreadsheet/Excel/Writer.php"); $workbook = new Spreadsheet_Excel_Writer(); $workbook->setVersion(8); $worksheet =& $workbook->addWorksheet(); $worksheet->setInputEncoding('UTF-8'); $CurrencyStyle =& $workbook->addFormat(); $CurrencyStyle->setNumFormat("#,##0.00 ¤"); /** this one works ok when added as text */ $worksheet->write(0,0,"2.15 ¤"); /** because the euro is added as a format, it now fails */ $worksheet->write(1,1,"2.15",$CurrencyStyle); $workbook->send('Euro.xls'); $workbook->close(); ?> Expected result: ---------------- Euro should display correctly in the sheet regardless if it is a format or a text.

Comments

 [2008-11-03 12:05 UTC] body (Yerbol Nyssanbekov)
Hi, I have the same problem... Does anybody know solution for this? Please help...
 [2009-08-05 18:41 UTC] progi1984 (Franck Lefevre)
-Status: Open +Status: Verified -Assigned To: +Assigned To: progi1984
 [2010-02-16 19:37 UTC] fvielle (Florent Vielle)
 [2010-03-31 15:26 UTC] progi1984 (Franck Lefevre)
-Status: Verified +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2010-03-31 15:26 UTC] progi1984 (Franck Lefevre)
Thanks to fveille Try with this code : $biffVersion = 8; //$biffVersion = null; $inputEncoding = 'UTF-8'; //Spreadsheet_Excel_Writer instance $workBook = new Spreadsheet_Excel_Writer(); //setting biff version $workBook->setVersion($biffVersion); //Worksheet instance $workSheet =& $workBook->addWorksheet(); if ($biffVersion == 8){ //setting inputEncoding $workSheet->setInputEncoding($inputEncoding);//useless if biff version != 6 $euroSign = "€"; //unicode } else { $euroSign = chr(128); //ASCII / ISO-8859 / what php/local do? } //adding user defined Excell formats $myNumFormat =& $workBook->addFormat(array('NumFormat'=>"# ##0.00 ".$euroSign)); //larger columns $workSheet->setColumn(0,1,25); //writting something $workSheet->write(0, 0, "The Euro sign : "); $workSheet->write(0,1,"\xE2\x82\xAC"); $workSheet->write(1, 0, "A formated number : "); $workSheet->write(1, 1, 1000, $myNumFormat); $workSheet->write(2, 0, "Some chineese characters : "); $workSheet->write(2, 1, "\xe6\xb1\x89 \xe5\xad\x97"); $workBook->send('my_test.xls'); $workBook->close();
 [2010-08-24 11:39 UTC] bowlkhin (pham anh tuan)
hi Franck Lefevre, I do apply your solution but there's no effect, it display unreadable sign instead of Euro sign. I set version = 8, input encoding = UTF-8, try with $workSheet->write(1, 1, 1000, $myNumFormat); thanks for any help,
 [2010-08-24 12:48 UTC] bowlkhin (pham anh tuan)
I'm sorry, I forgot to update the patch. Now it works correctly. Thanks :)
 [2011-10-05 20:00 UTC] savan (savan sakshi)
Hi All, I was having the same problem with euro sign during search i found this thread and i followed all the steps given in it. But instead of euro sign the blank sign is coming . before i have applied the patch some junk charchter was there now no character so strange not sure. Can anyone help me to get out of this. Thanks
 [2011-10-08 13:25 UTC] savan (savan sakshi)
Can anyone please help me to get out of this ? As I tried all the way here given but still the euro sign is not coming.... This are the steps I did: - Patched the file with the version provided - Utf-8 with the version 8 is passed - then the euro sign is applied. Is there any step am i missing can anyone please guide ?