今天被這個Header發送搞了一個小時多
從伺服器發給Browser 一個文件類型及編碼的Header
指令為
header('Content-Type: text/html ; charset=utf-8');
Firefox及Chrome都可以正確運行
一遇上IE就變成檔案下載...
最後才發現在 text/html 之後多了一個空格
將空格移除後,就正常了 ^^"
header('Content-Type: text/html; charset=utf-8');
順道補上其他語言的文件類型及編碼Header設定
Java
resource.setContentType ("text/html; charset=utf-8");
JSP
.Net
Response.ContentType = "text/html; charset=utf-8";
Asp
ref:http://jian-zhoung.blogspot.com/2009/02/header-ie.html