Link:http://output.to/sideway/default.asp?qno=120200008 CodePage Response ObjectAnother important function of Response object is the control of ASP engine for the HTML output. Response.CodePage PropertyResponse.CodePage property sets the value of code page for the data of response in the intrinsic objects to specify the character encoding for different languages in the server Syntax:Response.CodePage [=CodePageID] Or in an ASP file. Imply <% Response.Status[=CodePageID] %> Parameters:CodePageID The parameter "CodePageID" is the page code to represent the character code formatting used for the HTML output. The data type of "CodePageID" is integer. The possible CodePageID are
Remarks:The Response.CodePage property is used to specify CodePage of the body content of a page. Each output body content should have only one character set, otherwire the displayed characters will be incorrect. For each character set, there is a corresponding code page to represent the character code encoded in the intrinsic objects. And therefore there is always a code page for every response body output. If Response.CodePage is not explicitly set in a page, the value of CodePage for the page should be determined from other settings. If sessions are enabled, the Response.CodePage can then be implicitly set by the Session.CodePage. If sessions are not enabled and the @CodePage is present in the ASP file, the Response.CodePage can then be set by the @CodePage. If the @CodePage is not present in the ASP file, the Response.CodePage can then be set by the ASPCodePage metabase property. If the ASPCodePage metabase property is also not set or is set to 0, the Response.CodePage is then set by the system ANSI code page. In the case, the code page is set explicitly in two pages or in two different response outputs with one response output is called by the other response output, through #include, Server.Execute, or Server.Transfer, usually the code page of the child response output will be set by the parent response output. However if a Response.CodePage is explicitly set in the parent page of a Server.Execute call, an @CodePage command in the child page will override the parent code page. So, the explicit setting of Response.CodePage or Session.CodePage for nonliteral strings should be set before senting the output to the client. Besides the encoding of the response output of nonliteral strings in the intrinsic objects, the encoding of the literal strings in a script are still set by the @CodePage, the AspCodePage metabase property value, or the system ANSI code page with the same priority as for intrinsic objects. Therefore, when both literal and nonliteral strings are used in the same page, the code page setting by @CodePage should match with the code page setting by Response.CodePage, or the page will display incorrectly because the literal strings are encoded differently from the nonliteral strings in the response output. Since the system default code page will be used when there is no code page setting in a web page, sometimes it is not necessary to set a code page in the web page for those web client with matched system default code page. However, setting the code page for a web page is alway necessary for encoding the response output correctly for all web client in the WWW. And therefore if the code page is set in a page, the Response.Charset should also be set in order to ensure the response output is displayed correctly for all web client in the WWW. In order to make the response output display correctly, the file format of a web page must be stored with the same @CodePage setting used in the page. In window, notepad can save files in UTF-8 format or in the system ANSI format. Therefore the ASP file should be saved in UTF-8 format if the @CodePage is set to 65001. Since notepad can save files in system ANSI format according to the default system locale setting in the Regional and Language Options in the Control Panel, notepad can save file in different file format according to @CodePage setting by changing the system locale setting before saving the file. Similarly, in order to test web pages that use different code pages and character sets in a client computer, the corresponding language packs should also be installed through the adding of language packs in the Regional and Language Options in the Control Panel. Examples:
Link:http://output.to/sideway/default.asp?qno=120200009 USB2 Cruzer Switch Cruzer Switch USB2 Flash Drive(information from SanDisk)
Product Features:
Site of SanDisk
Links of USB
Links of Cruzer Switch USB2
|
Sideway BICK Blog 05/02 |