日期:2009-08-10  浏览次数:20794 次

Charset

Charset 属性将字符集名称(如 ISO-LATIN-7)附加到 Response 对象中 content-type 标题的后面。

语法

Response.Charset(CharsetName)

 

参数

CharsetName
指定该网页的字符集的字符串。字符集的名称将被附加到 Response 对象中的 content-type 标题的后面。

示例

对于不包含 Response.Charset 属性的 ASP 页,content-type 标题将为:

content-type:text/HTML

如果同样的 .ASP 文件包含

<% Response.Charset("ISO-LATIN-7") %>

则 content-type 标题将为:

content-type:text/HTML; charset=ISO-LATIN-7

 

注释

无论字符串表示的字符集是否有效,该功能都会将其插入 content-type 标题中。

如果某个页包含多个含有 Response.Charset 的标记,则每个 Response.Charset 都将替代前一个 CharsetName。这样,字符集将被设置为该页中 Response.Charset 的最后一个实例所指定值。

在 Macintosh 系统上,默认的 U.S. 字符集设置不是 ISO-LATIN-1。当处理文档时,用于 Macintosh 系统的个人 Web 服务器自动从 Macintosh 字符集转换为 ISO-Latin-1。在 U.S. 版本中,如果未使用 Response.Charset 转换字符集,而且用于 Macintosh 系统的个人 Web 服务器不转换字符集,那么所有网页都被假定为在 U.S. Macintosh 字符集中。

应用于

Response 对象