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

Bug #6108 error on writeString
Submitted: 2005-11-29 16:13 UTC
From: walen at mimuw dot edu dot pl Assigned: progi1984
Status: No Feedback Package: Spreadsheet_Excel_Writer
PHP Version: 5.0.4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 12 - 5 = ?

 
 [2005-11-29 16:13 UTC] walen at mimuw dot edu dot pl
Description: ------------ I've got a code that requires outputting many strings in the custom input encoding. Unfortunatelly the module returns broken XLS files. For the test script some strings are broken (random characters). I think that there is an error in the function _storeSharedStringsTable(). Test script: --------------- $xls = new Spreadsheet_Excel_Writer(); $xls->setVersion(8); $xls->setCountry(48); $xls_s = $xls->addWorksheet("test"); $xls_s->setInputEncoding('ISO-8859-2'); for($i=0;$i<500;$i++) { $str="aceąćę".$i; $xls_s->writeString($i,0,$str); } $xls->send('test.xls'); $xls->close(); Expected result: ---------------- 500 lines: "aceąćę".$i; (0<=i<500) Actual result: -------------- 400 lines: "aceąćę".$i; (0<=i<=400) then garbage

Comments

 [2005-12-05 23:40 UTC] fpascutti at tdcom dot fr
Doing a bit of debugging (with my absencde of knowledge of the Excel file format), I narrowed the bug down to _storeSharedStringsTable() as pointed before. It seems that you get an error after the first time you "cross the CONTINUE boundary". That is, the bug occurs after the first string that does not pass this test: // We can write the string if it doesn't cross a CONTINUE boundary if ($block_length < $continue_limit) { /* snip */ } Hope it will help...
 [2006-02-12 15:54 UTC] daniel dot burckhardt at sur-gmbh dot ch
I ported the ommitted aligment marked by TODO: Unicode data should only be split on char (2 byte) from http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.16/lib/Spreadsheet/WriteExcel/Workbook.pm to _calculateSharedStringsSizes and _storeSharedStringsTable and that seems to do the trick.
 [2006-02-12 16:15 UTC] daniel dot burckhardt at sur-gmbh dot ch
Sorry, that was premature. Still croaking on longer outputs :-(
 [2006-03-24 14:40 UTC] danielpeake at hotmail dot com (Dan Peake)
I've also enountered this bug and this is what I've found: - The bug happens when you use setInputEncoding to set the input encoding (obviously in a BIFF8 file). As far as I can tell this is because it only stores strings as UTF-16LE if you set the input encoding. - This being the case, it doesn't matter what characters (unicode/ascii) you input, it's simply the fact that they are being converted to, and stored as, UTF-16LE. - Also, when I tested it, there seemed to be magic numbers of characters that let you store as many lines as you liked (I think 20, 25, possibly 50-something..) - I also tracked down the TODO parts in calculateSharedStringsSizes and _storeSharedStringsTable and ported the missing bits from the PERL script. As Mr Burckhardt states, these made no difference whatsoever. To conclude, Spreadsheet_Excel_Writer can't currently store lots of unicode strings in an Excel sheet :(
 [2009-11-29 07:35 UTC] cschmitz (Carsten Schmitz)
-Status: Open +Status: Feedback
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2010-03-31 17:10 UTC] progi1984 (Franck Lefevre)
-Assigned To: +Assigned To: progi1984
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2010-03-31 17:10 UTC] progi1984 (Franck Lefevre)
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2011-09-29 14:04 UTC] doconnor (Daniel O'Connor)
-Status: Feedback +Status: No Feedback