Possible Duplicate:
How can I output a UTF-8 CSV in PHP that Excel will read properly?
I need to export from html table to excel file, but I'm having troubles with characters when I read de xml file..
Something like this:
Región should be like Región
Teléfono should be like Teléfono
This is my header definition:
header('Content-encoding: UTF-8');
header("Content-type: application/x-msexcel; charset=UTF-8");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-disposition: attachment; filename=" . $nombreArchivo . ".xls");
there is a BOM configuration, but don't know how set that in the header
Very Nice
I just apply this code just before the end of header
echo "\xEF\xBB\xBF";
and that solved the problem with the "special characters". thanks to mario :)
but
Now I still get this message when I want to open the downloaded file:
"The file you are trying to open, 'file.xls', has a different format than specified by the file extension. Make sure the file is not corrupted and is from a trusted source before opening. Do you want to open the file now?"
any ideas for avoid that message?