ASP page display garbled solution/asp set encoding

Source: Internet
Author: User

ASP page display garbled solution/asp set encoding (GO) If you find the page is garbled. You can try the steps: Make sure your page itself is properly encoded: for example, using Charset=utf-8 in test.asp, make sure the file itself is Utf-8 encoded. You can use Notepad to convert. Also, if you use CHARSET=GBK, make sure that the file itself is GBK encoded.
Verify that the original data (such as the data you get from the database) is encoded in the same way as the page is encoded.
Attempts to specify what encoding IIS reads by.
<%@ Codepage=65001%>utf-8
<%@ codepage=936%> Simplified Chinese
<%@ codepage=950%> Traditional Chinese
<%@ codepage=437%> US/Canada English
<%@ codepage=932%> Japanese
<%@ codepage=949%> Korean
<%@ codepage=866%> Russian
CODEPAGE specifies what encoding is read by IIS.
For example, with UTF-8 encoding, the top of the file is added <% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
For example, with GBK encoding, the top of the file is added <% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
Set ASP built-in object symbol mapping and response Content-type header encoding
If you use Utf-8 encoding, add the following on top of the article:
<% session.codepage=65001
response.charset= "UTF-8"%>
If you use GBK encoding, add the following on top of the article:
<% session.codepage=936
response.charset= "GBK"%>
Note that you can put the settings indicated in 3,4 to the top of a publicly contained file (for example, conn.asp). This property is applied to all pages.

ASP page display garbled solution/asp set encoding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.