Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Special characters in ASP .NET but not ASP

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

I have two projects - one "base" project written in ASP .NET and the other a "legacy" project written in ASP.

The following code (in C#) displays any/all special characters passed to it.

Code:
string postData = Server.UrlEncode(&quot;<?xml version=\&quot;1.0\&quot;?>&quot; +
&quot;<in2_message>&quot; +
&quot;<action>Request</action>&quot; + 
&quot;<messagetype>SRAU</messagetype>&quot; +
&quot;<user>&quot; +
&quot;<mode>E</mode>&quot; +
&quot;<userid>flower6</userid>&quot; +
&quot;<name>Testß</name>&quot; +
&quot;<surname>Userï</surname>&quot; +
&quot;</user>&quot; +&quot;</in2_message>&quot;);

ServerXMLHTTP30Class http = new ServerXMLHTTP30Class();
http.open &quot;POST&quot;,&quot;[URL unfurl="true"]http://david/webservicestranslation/default.aspx&quot;,[/URL] false,&quot;&quot;,&quot;&quot;);
http.send(&quot;apilogin=in2corporate&apipwd=password&data=&quot; + postData);
Response.Write(http.responseText);
If I try to translate this into straight asp - it won't display the special characters.

Here's the code:

Code:
Dim postData   
Dim http

set http = server.CreateObject(&quot;MSXML2.ServerXMLHTTP.3.0&quot;)

postData = Server.URLEncode(&quot;<?xml version=&quot;&quot;1.0&quot;&quot;?>&quot; & _
&quot;<in2_message>&quot; & _
&quot;<action>Request</action>&quot; & _
&quot;<messagetype>SRAU</messagetype>&quot; & _
&quot;<user>&quot; & _
&quot;<mode>E</mode>&quot; & _
&quot;<userid>flower6</userid>&quot; & _
&quot;<name>Testß</name>&quot; & _
&quot;<surname>Userï</surname>&quot; & _
&quot;</user>&quot; & _
&quot;</in2_message>&quot;)

http.open &quot;POST&quot;,&quot;[URL unfurl="true"]http://david/webservicestranslation/default.aspx&quot;,[/URL] false, &quot;&quot;, &quot;&quot;
http.send &quot;apilogin=in2corporate&apipwd=password&data=&quot; & postDataResponse.Write 
http.responseText

If anyone would prefer that I post this in the ASP.NET forum - please let me know - I just thought here would be best as the prob is on the ASP side.

Thanks as always

Craftor

:cool:
 
Apologies to all - this was supposed to have been posted in the ASP forum :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top