<ASP - euc-kr 기준>
[#1]
<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=euc-kr">
or
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
[#2]
Response.Buffer = True
Response.CharSet = "euc-kr"
'Response.CacheControl = "public"
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=엑셀파일명.xls"
[#3]
Session.CodePage = 949
<ASP - utf-8 기준>
[#1]
<meta http-equiv="Content-Language" content="ko">
FileName = Server.urlEncode("한글깨짐방지")
or
FileName = Server.URLPathEncode("한글깨짐방지")
<C# 기준>
[#1]
<meta name="viewport" http-equiv="Content-Type" content="text/html; charset=utf-8" />
or
<meta name="viewport" http-equiv="Content-Type" content="text/html; charset=euc-kr" />
[#2]
Response.Charset = "euc-kr";
Response.ContentType = "application/vnd.ms-excel";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("euc-kr");
[#3]
Response.Clear();
Response.ClearHeaders();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment; filename=" + "파일명_" + DateTime.Now.ToString("yyyy_MM_dd") + ".xls");
Response.Charset = "utf-8";
Response.ContentType = "application/vnd.xls";
string table = @"<Table><tr><td>111</td></tr><tr><td>222</td></tr></Table>";
Response.Write(table);
Response.End();
댓글 없음:
댓글 쓰기