Latest web development tutorials

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對象參考手冊