2025-04-27 07:49:33 -04:00

107 lines
5.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Charset</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
TempString = navigator.appVersion
if (navigator.appName == "Microsoft Internet Explorer"){
// Check to see if browser is Microsoft
if (TempString.indexOf ("4.") >= 0){
// Check to see if it is IE 4
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else {
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
}
}
else if (navigator.appName == "Netscape") {
// Check to see if browser is Netscape
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
//-->
</script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
Dim frmContents
On Error Resume Next
If Not Parent Is Nothing Then
Set frmContents = Parent.Contents
If Not frmContents Is Nothing Then
frmContents.Window.TOCSynch_Click
End If
End If
End Sub
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H4><A NAME="_charset"></A><SUP></SUP>Charset</H4>
<P>The <B>Charset</B> property appends the name of the character set (for example, ISO-LATIN-7) to the content-type header in the response object.</P>
<H6>Syntax</H6>
<P><B>Response.Charset</B>(<I>CharsetName</I>)</P>
<P>&nbsp;</P>
<H6>Parameters</H6>
<DL>
<DT><I>CharsetName</I></DT>
<DD>A <B>string</B> that specifies a character set for the page. The character set name will be appended to the content-type header in the <B>Response </B>object.</DD>
</DL>
<H6>Remarks</H6>
<P>This function inserts any string in the header, regardless of whether it represents a valid character set or not.</P>
<P>If a single page contains multiple tags containing <B>Response.Charset</B>, each <B>Response.Charset </B>will replace the previous <I>CharsetName</I>. As a result, the character set will be set to the value specified by the last instance of <B>Response.Charset </B>in the page.</P>
<P>If the codepage of your Web page matches the system defaults of the Web client, you do not need to set a codepage in your Web page. However, setting a codepage is recommended.</P>
<P>If the codepage is set using <B>Response.CodePage</B>, <B>Session.CodePage</B>, <B>@CodePage</B>, or the <B>AspCodePage</B> metabase property, <B>Response.Charset</B> should also be used. The codepage value tells IIS how to encode the data when building the response, and the charset value tells the browser how to decode the data when displaying the response. The <I>CharsetName</I> of Response.Charset must match the codepage value or mixed characters are displayed in the browser. Lists of <I>CharsetNames</I> and matching codepage values can be found at <a href="http://www.microsoft.com/isapi/redir.dll?prd=msdn&sbp=workshop&pver=6.0&ar=reference&sba=charsets " target=_blank><b>MSDN Web Workshop</b></a> under the columns for Preferred Charset Label and FamilyCodePage.</P>
<P>If you are writing and testing Web pages that use difference codepages and character sets (for example, creating a multi-lingual Web site), remember that your test client computer must have the language packs installed for each language you wish to display. You can install language packs from Regional Options in the Control Panel.</P>
<P>On Macintosh computers, the default U.S. character set is not ISO-LATIN-1. When serving up documents, Personal Web Server for Macintosh automatically converts from the Macintosh character set to ISO-Latin-1. In the U.S. version, all pages are assumed to be in the U.S. Macintosh character set unless the <B>Response.Charset </B>is used. If <B>Response.Charset</B> is used to change the character set, Personal Web Server for Macintosh does not convert the character set.</P>
<H6>Example</H6>
<P>For an ASP page that did not include the <B>Response.Charset</B> property, the content-type header would be </P>
<PRE><CODE>content-type:text/html
</CODE></PRE>
<P>If the same .asp file included</P>
<PRE><CODE>&lt;% Response.Charset= "ISO-LATIN-7" %&gt;
</CODE></PRE>
<P>the content-type header would be</P>
<PRE><CODE>content-type:text/html; charset=ISO-LATIN-7
</CODE></PRE>
<H6>Applies To</H6>
<P><A HREF="/iishelp/iis/htm/asp/vbob5sj8.htm"><B>Response</B> Object</A></P>
<H6>See Also</H6>
<P><A HREF="/iishelp/iis/htm/asp/vbob150l.htm"><B>CodePage</B></A></P>
<hr class="iis" size="1">
<p align="center"><em><a href="../../../common/colegal.htm">&copy; 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
</BODY>
</HTML>