Garbled text is actually not a problem. asp, PHP, and JSP have all of them. I think all the conversion encoding will happen. Generally, the same encoding method is used from start to end without garbled characters. The GBK encoding used by the database, and the GBK encoding is also specified on the page. Similarly, the database uses unicode encoding, and the page uses UTF-8 encoding. If garbled characters appear, the incorrect encoding format must be used.
use ASP as an example. If you find garbled characters appear during page browsing. You can try the following steps:
- make sure that the encoding format of your page is correct: for example, if charset = UTF-8 is used in test. asp, make sure that the file itself is Utf-8 encoded. You can use Notepad for conversion. If charset = GBK is used, make sure that the file is GBK encoded.
- confirm the encoding method of the original data (such as the data obtained from the database) and the page encoding method.
- try to specify the encoding used to read IIS.
<% @ codePage = 65001%> UTF-8
<% @ codePage = 936%> Simplified Chinese
<% @ codePage = 950%> traditional Chinese
<% @ codePage = 437%> American/Canadian English
<% @ codePage = 932%> Japanese
<% @ codePage = 949%> Korean
<% @ codePage = 866%> Russian
codePage specifies the encoding used to read IIS.
for example, using UTF-8 encoding, add <% @ Language = "VBScript" codePage = "65001" %>
on the top of the file, for example, using GBK encoding, add <% @ Language = "VBScript" codePage = "936" %> at the top of the file.
- set ASP built-in object symbol ing and response Content-Type Header encoding
if you use UTF-8 encoding, add
<% session at the top of Article . code Page = 65001
response. charset = "UTF-8" %>
if you use GBK encoding, add:
<% session. code Page = 936
response. charset = "GBK" %>
- Note: You can put the settings mentioned in 3, 4 at the top of a public-contained file (such as Conn. asp. This attribute is applied to all pages.