asp输出uft-8格式的xml文件
hnyou 2009-12-22 05:02:02 我的代码,不管我怎么弄,,它输出的中文文字都还是乱码。。。弄了1下午没有进展,请高手帮忙。。。多谢。。
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
%>
<%
Response.CodePage = 65001
Response.Charset="UTF-8"
Response.ContentType = "text/html"
db="../db/xiao.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
sql="select * from about where lb=1 order by px desc"
set rs=conn.execute(sql)
xmlfile=server.mappath("../about.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""utf-8""?>")
MyFile.WriteLine("<caidan>")
do while not rs.eof
lmname=rs("lmname")
aaa="<nei Name=""" & lmname & """ neiURL=""about.asp?id=" & rs("id") & """></nei>"
MyFile.WriteLine(aaa)
rs.movenext
loop
MyFile.WriteLine("</caidan>")
MyFile.Close
%>
<a href="admin.asp">返回</a>