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

Bug #9533 mbstring.func_overload breaks Spreadsheet_Excel_Writer
Submitted: 2006-12-04 04:59 UTC Modified: 2006-12-19 10:57 UTC
From: warrenklint at gmail dot com Assigned:
Status: Open Package: Spreadsheet_Excel_Writer (version 0.9.1)
PHP Version: 5.1.2 OS: Ubuntu Dapper LTS
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: warrenklint at gmail dot com
New email:
PHP Version: Package Version: OS:

 

 [2006-12-04 04:59 UTC] warrenklint at gmail dot com (Warren Klint)
Description: ------------ Using php.ini's mbstring.func_overload = 7 breaks Spreadsheet_Excel_Writer

Comments

 [2006-12-04 05:17 UTC] warrenklint at gmail dot com
The following script, along with mbstring.func_overload = 7 in php.ini, will produce an invalid XLS file: <?php // Include PEAR::Spreadsheet_Excel_Writer require_once "Spreadsheet/Excel/Writer.php"; // Create an instance $xls =& new Spreadsheet_Excel_Writer(); // Send HTTP headers to tell the browser what's coming $xls->send("test.xls"); // Add a worksheet to the file, returning an object to add data to $sheet =& $xls->addWorksheet('Binary Count'); // Write some numbers for ( $i=0;$i<11;$i++ ) { // Use PHP's decbin() function to convert integer to binary $sheet->write($i,0,decbin($i)); } // Finish the spreadsheet, dumping it to the browser $xls->close(); ?>
 [2006-12-04 07:41 UTC] warrenklint at gmail dot com
A _workaround_ for this is: // save current encoding somewhere safe $original_encoding = mb_internal_encoding(); // hack mb_internal_encoding('ISO-8859-1'); // do spreadsheet stuff here // set the encoding back again mb_internal_encoding($original_encoding); But this defeats the point, because it prevents non-iso1 data being saved.
 [2006-12-12 10:29 UTC] warrenklint at gmail dot com
Hi! Any news on this? Thanks :)
 [2006-12-19 10:57 UTC] warrenklint at gmail dot com
I saw that this is fixed for the Perl equivalent, works with perl 5.8+