日期:2014-05-17  浏览次数:20757 次

怎样写成utf-8码?
123.asp是一个utf-8的文件,用下列代码代替动态包含<!--#include file="123.asp" -->语句时出现乱码(写入的代码变成gb2312的了)。怎样写成utf-8码:
VBScript code

<%
Function getFileContents(strIncludeFile) '函数:读取包含文件内容
Dim objFSO,objText
Set objFSO = Server.CreateObject("Scripting.FileSystemObject") '调用FSO对象
Set objText = objFSO.OpenTextFile(Server.MapPath(strIncludeFile))
getFileContents = objText.ReadAll
objText.Close
Set objText = Nothing
'这里要不要增加objFSO.Close?
Set objFSO = Nothing
End Function

response.write getFileContents("123.asp")
%>



------解决方案--------------------
直接用 Server.Execute "123.asp" 乱码吗?