Bug #9062 [Com]: Euro does not appear correctly in formula styles
| From: | bowlkhin@yahoo.com | Date: | Tue, 24 Aug 2010 08:48:25 +0000 |
| Subject: | Bug #9062 [Com]: Euro does not appear correctly in formula styles | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4651@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=9062&edit=1
ID: 9062
Comment by: bowlkhin@yahoo.com
Reported By: simon at elroble dot co dot uk
Summary: Euro does not appear correctly in formula styles
Status: Closed
Type: Bug
Package: Spreadsheet_Excel_Writer
Operating System: Apache Webserver | Windows XL
Package Version: 0.9.1
PHP Version: 4.4.3
Assigned To: progi1984
Roadmap Versions:
New Comment:
I'm sorry, I forgot to update the patch. Now it works correctly.
Thanks :)
Previous Comments:
------------------------------------------------------------------------
[2010-08-24 07:39:29] bowlkhin
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-03-31 11:26:18] progi1984
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-03-31 11:26:06] progi1984
-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-02-16 14:37:01] fvielle
Added #patch
bug:9062;patch:corect_unicode_encoded_number_format;revision:1266331021;.
------------------------------------------------------------------------
[2009-08-05 14:41:38] progi1984
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: progi1984
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=9062
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=9062&edit=1