Two days to find a solution .... Halo Halo ... Solved with the second method.
None of the methods found on the Internet have written this one.
If objasperror.aspdescription > "Then
The rear carriage return is removed (this place Microsoft wrote wrong)
Comment out the <br> in the back of this sentence!
Response.Write Server.HTMLEncode (objasperror.aspdescription) ' & <br> '
Transferred from: http://blog.csdn.net/Kevin__lin/article/details/4149784
Solve the problem of error garbled in UTF-8 file under IIS
Reason:
Your site is utf-8 encoded, but the error message output of IIS is using GB2312 encoding by default. The page that is displayed when IIS causes a run-time error is garbled.
Workaround:
[Method 1]
Handle the error yourself and not allow IIS to handle it.
In all possible places where mistakes are made, they are captured in a manner similar to the following.
On Error Resume Next
Err.Raise 6 ' This line is a possible error code
If ERR Then
Response.Write Err.Description
Response.End
End If
On Error Goto 0
[Method 2]
Change the IIS error message output default encoding.
1) Copy the c:/winnt/help/iishelp/common/500-100.asp to the website (root) directory
2) Change this file to Utf-8 encoding.
2.1) head plus @codepage =65001
2.2) Option Explicit after adding a line response.charset= "Utf-8"
2.3) Change Session.CodePage = 936 to Session.CodePage = 65001
2.4) The 156th Line
If objasperror.aspdescription > "Then
The rear carriage return is removed (this place Microsoft wrote wrong)
2.5) Configure IIS, set the custom error page, set the type of 500;100 as a URL, and the URL to/500-100.asp
2.6) Save 500-100.asp as Utf-8 encoding
[Go] solve the problem of UTF-8 file error garbled under IIS