If you create a Web page on a computer whose default code page is the same as the default code page of the Web server, you do not have to declare a code page in your Web page, though it is recommended.
If you create a Web page on a computer whose default code page is not the same as the default code page of the Web server, you need to specify the code page so that strings are correctly converted internally to unicode and back again.
To specify the code page for an ASP page, use the AspCodePage metabase property, the @CODEPAGE directive, the Session.CodePage property, or the Response.CodePage property. For example, to set the code page to Japanese, set the AspCodePage property for your application to 932 using one of the following commands.
IIS 5.0 and earlier: Response.CodePage is not available.
<%@ CODEPAGE = 932 %>
<% Session.CodePage = 932 %>
<% Response.CodePage = 932 %>
If you use the @CodePage directive, you must save the ASP page in the file format that matches the @CodePage directive. For example, if @CodePage is set to 65001, the Web page must be saved in UTF-8 format. If @CodePage is set to 932, the Web page must be saved in ANSI format on a computer that has the default system locale set to Japanese.
When a script is executed, IIS determines how characters are encoded using the following hierarchy:
There can only be one code page per Web page. If you use @CodePage and one other method, make sure you set them to the same code page, or one of them to UTF-8. @CodePage affects literal strings and the other code page properties affect string variables, so if two incompatible code pages are mixed, the browser displays the literal strings incorrectly.