I generate and upload the .xls file through the old Spreadsheet_Excel_Writer () class as follows:
$xls = new Spreadsheet_Excel_Writer(); $xls->setVersion(8); $sheet = $xls->addWorksheet(iconv('UTF-8', 'Windows-1251','list')); $sheet->setInputEncoding('CP1251'); $sheet->write( 0, 0, iconv( 'UTF-8', 'Windows-1251', 'Тест' ) ); $sheet->write( 1, 0, iconv( 'UTF-8', 'Windows-1251', 'Тест2' ) ); $sheet->write( 2, 0, iconv( 'UTF-8', 'Windows-1251', 'test' ) ); $xls->send( 'test.xls' ); $xls->close(); Excel 2007 on Windows 7 refuses to open this file ("the file has the wrong format" or something), but Ubuntu's LibreOffice opens and displays the file perfectly, even with the necessary encoding. I tried in every way to change the encodings, versions, etc. - it did not help.
What could be the problem?