1.关于session中编码说明
默认情况下,编码是GB2312格式输出中文,如果想修改成UTF-8格式输出中文,需在页面中加入Session.CodePage=65001
2.关于输出xml文件的编码格式
输出为UTF-8格式代码:
q=chr(34)'表示引号
t=chr(9)'表示Tab键
hh=chr(10)&chr(13)'表示换行
xml=root&"xxx.xml" '填写地址和文件名称
set fs=server.CreateObject("ADODB.Stream")
with fs
.type=2
.mode=3
.open
.charset="utf-8"
.position=fs.size
.writetext ("<?xml version="&q&"1.0"&q&" encoding="&q&"utf-8"&q&"?>")
.writetext ....
.savetofile xml,2
.close
end with
输出为GB2312格式代码:
set fso=server.createobject("scripting.filesystemobject")
set ts=fso.opentextfile(server.mappath("xx.xml"),2,true)
q=chr(34)
t=chr(9)
ts.writeline("<?version="&q&"1.0"&q&" encoding="&q&"GB2312"&q&"?>")
ts.writeline(...)....
ts.close
默认情况下,编码是GB2312格式输出中文,如果想修改成UTF-8格式输出中文,需在页面中加入Session.CodePage=65001
2.关于输出xml文件的编码格式
输出为UTF-8格式代码:
q=chr(34)'表示引号
t=chr(9)'表示Tab键
hh=chr(10)&chr(13)'表示换行
xml=root&"xxx.xml" '填写地址和文件名称
set fs=server.CreateObject("ADODB.Stream")
with fs
.type=2
.mode=3
.open
.charset="utf-8"
.position=fs.size
.writetext ("<?xml version="&q&"1.0"&q&" encoding="&q&"utf-8"&q&"?>")
.writetext ....
.savetofile xml,2
.close
end with
输出为GB2312格式代码:
set fso=server.createobject("scripting.filesystemobject")
set ts=fso.opentextfile(server.mappath("xx.xml"),2,true)
q=chr(34)
t=chr(9)
ts.writeline("<?version="&q&"1.0"&q&" encoding="&q&"GB2312"&q&"?>")
ts.writeline(...)....
ts.close