PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #9533

mbstring.func_overload breaks Spreadsheet_Excel_Writer

Details

Submitted2006-12-04 09:59 UTC
Fromwarrenklint at gmail dot com
StatusWont fix
PackageSpreadsheet_Excel_Writer
PHP Version5.1.2
OSUbuntu Dapper LTS
Roadmaps(Not assigned)

Comments

[2006-12-04 09:59 UTC] warrenklint at gmail dot com

Description:
------------
Using php.ini's
mbstring.func_overload = 7
breaks Spreadsheet_Excel_Writer

[2006-12-04 10: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 12: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 15:29 UTC] warrenklint at gmail dot com

Hi!
Any news on this?

Thanks :)

[2006-12-19 15:57 UTC] warrenklint at gmail dot com

I saw that this is fixed for the Perl equivalent, works with perl 5.8+