如果用adodb.stream控件来进行转码,就简单多了,不需要借助vbs的二进制处理函数了,同时速度快了很多。
复制代码 代码如下:
<script>
function loaddata(surl){
var xh
xh=new activexobject("microsoft.xmlhttp")
xh.open("get",surl,false)
xh.send(null)
return gb2utf8(xh.responsebody)
}
function gb2utf8(sdata){
var ostream
ostream=new activexobject("adodb"+".stream")
ostream.type=1
ostream.mode=3
ostream.open
ostream.write(sdata)
ostream.position=0
ostream.type=2
ostream.charset="gb2312"
return ostream.readtext()
}
</script>
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!