作者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