Use asp and access database, and the webpage code is UTF-8. Garbled characters appear, and all the text read from the database is garbled.
Solution:
<% @ Codepage = "65001" %>
<Http-equiv = "Content-Type" content = "text/html; charsets = UTF-8">
One cannot be less
In addition, files must be stored in UTF-8 format
Also, the program cannot go wrong.
If there is an incorrect program, it will be normal when it is just opened. If it is refreshed, it will be garbled.
The error described here does not cause the error that is not displayed on the entire page.
1, <% @ codepage = "65001" %>
2, 3, Session. CodePage = 65001
4, the file is saved as a UTF-8
Let me talk about it. I have more experience.
2, ========================================================
This is important and common. It determines which internal code the browser chooses to access your webpage.
4, the file is saved as a UTF-8
If you use the Chinese Input Method, the web page appears Chinese, this is more important, because we use the common input method of text is not UTF format, so you have to save to the UTF-8 format.
All text read from the database is garbled
==================================
1, <% @ codepage = "65001" %>
In this case, please add this sentence. In fact, the database has nothing to do with the internal code. The key is what internal code the ASP program uses to transmit your data, it forces ASP to use UTF to transmit data.
Try to add a row under <% @ codepage = "65001" %>:
<% Session. CodePage = 65001%>