In fact, there is nothing special. I mainly read the Microsoft VBA Object Manual and found that you can directly use adodbStream to convert charSet. The examples I saw before were all done using VBScript, so I wrote a pure Javascript example
Unfortunately, due to security restrictions, this stuff can only be used by people who make HTA...sigh....
function loadURL(strURL,strSend,strMethod,blnNotWait,aryHeads){
if(!strURL){return(false);}
strSend =strSend?strSend:"";
strMethod=strMethod=="POST"?"POST":"GET";
blnNotWait=blnNotWait?true:false;
var xmlHTTP=new ActiveXObject("MSXML2 .XMLHTTP"); try {
){
return(xmlHTTP); 🎜> var adodbStream=new ActiveXObject("ADODB.Stream");
adodbStream.Type=1;//1=adTypeBinary
adodbStream.Open();
adodbStream.write( xmlHTTP.responseBody);
adodbStream.position=0;
adodbStream.Type=2;
adodbStream.charset="_autodetect_all";
var re=adodbStream.readText();
adodbStream=null;
return(re);
}
}