ASP + Chinese display Solution

Source: Internet
Author: User


The first major problem encountered when I first started writing ASP + programs was the Chinese display problem. After running the program, I found that ASP + was read from the database.
All the obtained Chinese characters are converted ?????, Similar to jsp, the most frequently displayed problem occurs in Chinese.
Two methods can be used to easily solve Chinese problems.

Method 1:

After reading the Microsoft NGWS documentation, I found that the FAQ section of this document mentions that you need to add a config. web file
In the web directory, I tried it. The Chinese display is OK.
The method is as follows:

Create a config. web file with the following content in the WEB directory:

Requestencoding = "UTF-8"
Responseencoding = "UTF-8"
/>

Later, I saw a post in the Forum saying that it would be okay to change UTF-8 to gb2312. I have not tried it. You can try it.

Method 2:

Later, I subscribed to Microsoft's newsgroup and found it discussed in Microsoft's newsgroup dotnet. framework. aspplus. general.
To add <% @ CODEPAGE = "936" %> to the beginning of each page.
<% @ Page contentType = "text/html; charset = gb2312" %>
Hurry up and test it. OK !!!

The example is shown below:
<% @ CODEPAGE = "936" %>
<% @ Import Namespace = "System. Data" %>
<% @ Import Namespace = "System. Data. ADO" %>
<% @ Import Namespace = "System. Globalization" %>




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.