ASP Charset 屬性


Response 對象參考手冊 完整的 Response 對象參考手冊

Charset 屬性向 Response 對象中 content-type 頭部追加字元集名稱。默認字元集是 ISO-LATIN-1。

注意:此屬性可接受任何字串,不論是否為合法的字元集名稱。

語法

response.Charset(charsetname)

參數 描述
charsetname 為頁面規定字元集的字串。

實例

如果 ASP 頁面沒有設置 Charset 屬性,那麼 content-type 頭部會是這樣的:

content-type:text/html

如果我們使用了 Charset 屬性:

<%response.Charset="ISO-8859-1"%>

content-type 頭部會是這樣的:

content-type:text/html; charset=ISO-8859-1


Response 對象參考手冊 完整的 Response 對象參考手冊