I take data from SQL server.
I create a long string with spaces between fields and newlines for new rows.
Then I convert the string with iconv from windows-1255 to UTF-8 and save the string to a file test.xls.
When I open the file in OpenOffice spreadsheet the table is displayed correctly if I choose the UTF encoding.
But opening the file in MS excel, the fields are displayed correctly, but Hebrew text is not.
My question is: In which encoding should I save the file to be displayed correctly in Excel?
Use PHPExcel to create actual Excel documents rather than mislabelled CSV. The problem is that CSV has no encoding metadata, and which encoding Excel will use depends on the system settings (i.e. there is no “standard encoding”).