Solved

ActiveXObject("Msxml2.XMLHTTP") for chineese characters

Posted on 2012-04-10
2
512 Views
Last Modified: 2012-08-13
Hello,

I am using ActiveXObject("Msxml2.XMLHTTP") to instantiate the xmlhttp object to make a request to the server.  The responseText property has the english and chineese/Hindi characters.  The english characters are fine.  However, the chineese or hindi become funky characters.  Here is the code snippets:

------------------------------------------------------------------------------------------------------------------------------
objXMLRequest = new ActiveXObject("Msxml2.XMLHTTP"); //microsoft.xmlhttp");
objXMLRequest.open("POST", url, false);
objXMLRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 
//Make sure you escaped your strings prior to building this string.
objXMLRequest.send(a_strRequest);

//get the status response      
strReturn = objXMLRequest.responseText;

-------------------------------------------------------------------------------------------------------------------------------

the strReturn has some data like this:

----------------------------------------------------------------------------
<OPTION value="1"  >2K8SCMCOLL</option><OPTION value="2"  >नमस्तॿ</option><OPTION value="3"  >ä½ å¥½</option>
------------------------------------------------------------------------------------------------

the funky characters above are correctly stored in Chineese in DB.
0
Comment
Question by:OneCorner
2 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 500 total points
ID: 37829685
Please add these lines on TOP of your ASP page:

<%
Response.CodePage = 65001
Response.CharSet = "UTF-8"

%>

also see this article for reference:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/HTML/Q_27654707.html
0
 

Author Closing Comment

by:OneCorner
ID: 37833362
Thanks for your help!  It works perfect.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question