參考網址:http://www.lslnet.com/linux/f/docs1/i28/big5225614.htm
使用檔案:
1. sample01.html 要載入的 utf-8 檔案,內容如下:
2. out_file.asp 要執行的檔案 使用 utf-8 檔案,內容如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Function LoadFile(ByVal File)
Dim objStream
On Error Resume Next
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Type = 2
.Mode = 3
.Open
.LoadFromFile Server.MapPath(File)
If Err.Number<>0 Then
Response.Write "出錯,文件不存在"
Err.Clear
Response.End
End If
.Charset = "utf-8"
.Position = 2
LoadFile = .ReadText
.Close
End With
Set objStream = Nothing
End Function
%>
<%=LoadFile("./sample01.html")%>
<%=replace(LoadFile("./sample01.html"),"123","一二三")%><-- font="">
-->
使用檔案:
1. sample01.html 要載入的 utf-8 檔案,內容如下:
測試中文 |
test123 Table |
2. out_file.asp 要執行的檔案 使用 utf-8 檔案,內容如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Function LoadFile(ByVal File)
Dim objStream
On Error Resume Next
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Type = 2
.Mode = 3
.Open
.LoadFromFile Server.MapPath(File)
If Err.Number<>0 Then
Response.Write "出錯,文件不存在"
Err.Clear
Response.End
End If
.Charset = "utf-8"
.Position = 2
LoadFile = .ReadText
.Close
End With
Set objStream = Nothing
End Function
%>
<%=LoadFile("./sample01.html")%>
<%=replace(LoadFile("./sample01.html"),"123","一二三")%><-- font="">
-->