Fixed issue #9062: Euro does not appear correctly in formula styles - patch by fvielle
git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@297215 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
442d157fdf
commit
b148992d6a
|
|
@ -1014,12 +1014,23 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
|
||||||
$length = 3 + strlen($format); // Number of bytes to follow
|
$length = 3 + strlen($format); // Number of bytes to follow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $this->_BIFF_version == 0x0600 && function_exists('iconv') ) { // Encode format String
|
||||||
|
if (mb_detect_encoding($format, 'auto') !== 'UTF-16LE'){
|
||||||
|
$format = iconv(mb_detect_encoding($format, 'auto'),'UTF-16LE',$format);
|
||||||
|
}
|
||||||
|
$encoding = 1;
|
||||||
|
$cch = function_exists('mb_strlen') ? mb_strlen($format, 'UTF-16LE') : (strlen($format) / 2);
|
||||||
|
} else {
|
||||||
|
$encoding = 0;
|
||||||
$cch = strlen($format); // Length of format string
|
$cch = strlen($format); // Length of format string
|
||||||
|
}
|
||||||
|
$length = strlen($format);
|
||||||
|
|
||||||
$header = pack("vv", $record, $length);
|
|
||||||
if ($this->_BIFF_version == 0x0600) {
|
if ($this->_BIFF_version == 0x0600) {
|
||||||
|
$header = pack("vv", $record, 5 + $length);
|
||||||
$data = pack("vvC", $ifmt, $cch, $encoding);
|
$data = pack("vvC", $ifmt, $cch, $encoding);
|
||||||
} elseif ($this->_BIFF_version == 0x0500) {
|
} elseif ($this->_BIFF_version == 0x0500) {
|
||||||
|
$header = pack("vv", $record, 3 + $length);
|
||||||
$data = pack("vC", $ifmt, $cch);
|
$data = pack("vC", $ifmt, $cch);
|
||||||
}
|
}
|
||||||
$this->_append($header . $data . $format);
|
$this->_append($header . $data . $format);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue