2010/10/06

ASP UTF8 亂碼問題 解決方法

ASP 使用非Server 預設字集時 會導致亂碼
解決辦法:

1.  <%@ LANGUAGE=VBScript CODEPAGE=65001 %>  !!!寫在 asp 第一行!!!
2.  Response.CodePage=65001
3.  Session.CodePage=65001
4.  輸出 HTML: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

簡體中文 charset=gb2312 CodePage=936
繁體中文 charset=Big5 CodePage=950

至於 Response.CodePage 跟 Session.CodePage 的差別...
MSDN 有說明: http://msdn.microsoft.com/en-us/library/ms524628(VS.90).aspx

沒有留言:

張貼留言