Fixed issue #12362: named worksheets & utf-8 - patch by cfhay
git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@297578 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
b148992d6a
commit
7803f30184
|
|
@ -322,6 +322,10 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
|||
if (strlen($name) > 31) {
|
||||
return $this->raiseError("Sheetname $name must be <= 31 chars");
|
||||
}
|
||||
} else {
|
||||
if(function_exists('iconv')) {
|
||||
$name = iconv('UTF-8','UTF-16LE',$name);
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the worksheet name doesn't already exist: a fatal Excel error.
|
||||
|
|
@ -773,6 +777,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
|||
* @access private
|
||||
*/
|
||||
function _storeExterns()
|
||||
|
||||
{
|
||||
// Create EXTERNCOUNT with number of worksheets
|
||||
$this->_storeExterncount(count($this->_worksheets));
|
||||
|
|
@ -928,11 +933,15 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
|||
}
|
||||
|
||||
$grbit = 0x0000; // Visibility and sheet type
|
||||
if ($this->_BIFF_version == 0x0600) {
|
||||
$cch = mb_strlen($sheetname,'UTF-16LE'); // Length of sheet name
|
||||
} else {
|
||||
$cch = strlen($sheetname); // Length of sheet name
|
||||
}
|
||||
|
||||
$header = pack("vv", $record, $length);
|
||||
if ($this->_BIFF_version == 0x0600) {
|
||||
$data = pack("Vvv", $offset, $grbit, $cch);
|
||||
$data = pack("VvCC", $offset, $grbit, $cch, 0x1);
|
||||
} else {
|
||||
$data = pack("VvC", $offset, $grbit, $cch);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue