Solve the problem of UTF-8 file error garbled under IIS
Reason:
Your site is utf-8 encoded, but the error message output for IIS defaults to using GB2312 encoding. The page displayed is garbled when a run-time error occurs in IIS.
Solution:
[Option 1]
Handle the error yourself and do not allow IIS to handle it.
In all possible areas of error, it is 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
[Option 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 Modify this file to Utf-8 encoding.
2.1) head plus @codepage =65001
2.2 Option Explicit followed by 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
Back of the carriage return to remove (this place Microsoft wrote wrong)
2.5 Configure IIS, set the custom error page, set the 500;100 type as the URL, and the URL set to/500-100.asp
2.6) Save 500-100.asp as Utf-8 encoding