Solution of garbled problem when ASP reads SQL data

Source: Internet
Author: User

If you are doing the site, can not execute the SQL statement correctly, after response, found in the SQL statement inside the text section has become garbled, you can use the following method to resolve:

<%@ codepage=936%>简体中文
<%@ codepage=950%>繁体中文
<%@ codepage=65001%>UTF-8

CODEPAGE specifies what IIS encodes to read the string passed over (form submission, address bar delivery, etc.).

The reason for the garbled is that the site should be integrated when the module code is not the same cause.

The most convenient methods are as follows:

Do not convert any module page encoding the Utf-8 or utf-8, the Gb22312 or Gb2312.

In the Utf-8 module of the package file (such as conn.asp, but note that conn.asp must be called in the first line), add the front:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>

At the top of the package file for the GB2312 module, add:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Session.CodePage=936%>

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.