Solved

ActiveXObject("Msxml2.XMLHTTP") for chineese characters

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now