htmlテーブルからエクセルファイルにエクスポートしたいのですが、de xmlファイルを読み込むと文字化けして困っています。
このようなもの:
Región should be like Región
Teléfono should be like Teléfono
これは私のヘッダー定義です:
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");
BOM 構成がありますが、ヘッダーに設定する方法がわかりません
非常に素晴らしい
ヘッダーの最後の直前にこのコードを適用するだけです
echo "\xEF\xBB\xBF";
そして、それは「特殊文字」の問題を解決しました。マリオに感謝:)
しかし
ダウンロードしたファイルを開こうとすると、今でもこのメッセージが表示されます。
"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?"
そのメッセージを回避するためのアイデアはありますか?