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" %>