Inconsistent encoding (936 to UTF-8) Chinese garbled characters after sending XMLHTTP to URL

Source: Internet
Author: User

Function gethtml (Surl, surl01 ){
VaR xmlrequest;
Xmlrequest = new activexobject ("msxml2.serverxmlhttp ");
Xmlrequest. Open ("Post", Surl, false );
Xmlrequest. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded ");
Xmlrequest. Send (surl01 );
Return xmlrequest. responsetext;
}

// Send an email
Function Sendmail (email, title, note, CC ){
Try {
VaR _ codePage = session. codePage; // obtain the original code of the page.
Session. codePage = 65001; // set it to 65001
VaR code = "w00003 ";
VaR Title = server. urlencode (title );
VaR note = server. urlencode (note );
VaR url = "123.asp ";
If (! CC) CC = "";
VaR url01 = ("sender =" + email + "& CC =" + CC + "& Title =" + title + "& code =" + code + "& note =" + note );
// Writeln (note );
// Writeln (URL + "? "+ Url01 );
// Response. End ();
Gethtml (URL, url01 );
Session. codePage = _ codePage; // restore to original code
} Catch (e ){}
}
// Send email end

 
// Send SMS
Function sendsms (sender, note ){
Try {
VaR _ codePage = session. codePage;
Session. codePage = 65001;
VaR code = "w00003 ";
VaR note = server. urlencode (note );
VaR url = "123.asp ";
VaR url01 = "sender =" + sender + "& code =" + code + "& note =" + note;
// Writeln (url01 );
// Response. End ();
Gethtml (URL, url01 );
Session. codePage = _ codePage;
} Catch (e ){}
}
// Send the SMS end

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.