Solved

ActiveXObject("Msxml2.XMLHTTP") for chineese characters

Posted on 2012-04-10
2
510 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Understanding mobile browsers 9 65
Checking data with javascript 3 19
jqury 17 30
how can I add blockquote after on my wordpress site 3 10
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

777 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