Home » File Formats » Spreadsheet_Excel_Writer » Bug #4482
Can't use Windows-1251 encoding
Details
| Submitted | 2005-05-31 06:39 UTC |
|---|---|
| From | izhekov at ppartner dot com |
| Assigned | xnoguer |
| Status | Closed |
| Package | Spreadsheet_Excel_Writer |
| PHP Version | 5.0.3 |
| OS | Windows |
| Roadmaps | (Not assigned) |
Comments
[2005-05-31 06:39 UTC] izhekov at ppartner dot com
Description:
------------
Windows-1251 encoding does not work when opened with OpenOffice for Linux or on Excel for Mac. At the same time it displays characters correctly under Windows.
The example code writes the Bulgarian alphabet into a cell of excel table.
When I open it from Windows it looks good, but opening the same excel file with OpenOffice or with the latest version of Excel for MAC it displays strange characters.
Isn't there a way to specify the encoding Windows-1251 for a excel spreadsheet?
Reproduce code:
---------------
$xls_file = "../tmp/late_orders_report-".date("d.m.Y").".xls";
$xls =& new Spreadsheet_Excel_Writer($xls_file);
$sheet =& $xls->addWorksheet('Report');
$sheet->write(0, 0, "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯ");
$xls->close();
Expected result:
----------------
Using encoding Windows-1251 the result to be the same when opening with Excel for Windows or MAC, and also with OpenOffice for Linux.
Actual result:
--------------
Characters are not displayed correctly under OpenOffice (Linux) and under Excel for MAC.
[2005-11-08 04:11 UTC] xnoguer at php dot net
This bug has been fixed in CVS.
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.
Please check http://pear.php.net/bugs/bug.php?id=1572
. You should use
setInputEncoding('windows-1251');