在做采集的朋友就會知道經常會碰到采集過來的內容是亂碼
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="
<html>
<head>
<meta http
<title>asp自動判斷網頁編碼並轉換</title>
</head>
<%Server
function send_request(url){
var codedtext;
("Microsoft
("GET"
(null);
if {
//自動判斷編碼開始
var charresult = (/CharSet=(S+)">/i);
if (charresult != null){
var Cset = charresult[
}else{Cset = "gb
//自動判斷編碼結束
codedtext = bytesToBSTR
}else{
codedtext = "Erro";
}
return(codedtext);
}
function bytesToBSTR(body
var objstream;
objstream = Server
objstream
objstream
objstream
objstream
objstream
objstream
objstream
bytesToBSTR = objstream
objstream
return(bytesToBSTR);
}%>
<body>
<%Response
</body>
</html> 采集原理很簡單就是用了asp xmlhttp來采集
From:http://tw.wingwit.com/Article/program/net/201311/14446.html