garbled out problem

Topics: User Forum
May 30, 2012 at 5:44 PM

Im trying the simple examples -01simple.xls- that come with PHPExcel im getting garbled output. It (LibreOffice) wants to import the file it thinks the char set is Western Europe DOS/OS2-861.icelandic and the output is like this if i copynpaste from the produced spreadsheet

╨╧αí▒ß ■                                                                                                                                                                                                                                                                                                                                                                                                                                                   ╗ ╠╤B░=╝%r8X"1▄ÉCalibriα⌡  ╗ ╠╤*+éÇü┴âä&ffffffµ?'ffffffµ?(Φ?)Φ?í"dXX333333╙?333333╙?U}$ }$ }$ }$ ² ² ² ²

╢@gg      Root

something  somewhere about character encoding ? but what, and where?

OS =ubuntu server

PHPExcel v 1.7.6 ( in 1.7.7. the folder structure isnt right)

May 30, 2012 at 7:59 PM

I don't understand this at all. I've tried loading the 01simple.xls files created by both 1.7.6 and 1.7.7 using LibreOffice 3.4.4, and both open cleanly.

Try opening the file in a text editor and see what it looks like: it's always possible that spurious characters have been injected at the beginning or end of the file, or that it contains some PHP error message that renders it unreadable as an xls.

May 30, 2012 at 8:29 PM

it wont open with gedit( says its a binary file) , but  can with a hex editor

is the file that is downloaded

Im trying to add an excel download option to timesheet-ng ( an OSS  project hosted on sourceforge)

the file that generates the document is

with the get variable at line 55 and the bit that writes the excel file at 153

May 31, 2012 at 6:38 AM

Looking at your file, it has two spurious line feed characters as the first two bytes. Like browser headers in normal PHP, there should be no additional output written to the file. Somewhere, the script is generating these additional empty lines of output.