作者dingyuchi (fish)
看板Ajax
标题Re: [问题] 请教httprequest之後乱码的问题
时间Wed Aug 1 11:01:40 2007
※ 引述《joehwang (便宜十块钱)》之铭言:
: 大家好
: 我利用httprequest抓取另一张网页时,如果目标网页编码是big5
: 那麽抓回来的资料就是乱码,改设为utf8中文则又正常了
: 上google查询後发现javascript会把资料转为utf8,请问有什麽办法
: 可以利用httprequest读入big5编码的文字又不会变成乱码呢?
: 谢谢大家的回答^^
Function BytesToBstr(body,Cset)
dim objstream
Set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
msgbox bytesToBSTR(.ResponseBody,"big5")
试看看
--
http://www.wretch.cc/blog/dingyuchi
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.135.22.242