Home All Groups Group Topic Archive Search About

Problems with sending an encoded url



Author
31 Aug 2006 6:58 AM
Kavita.K.Singh
Hello Gurus
thankyou for your help in advance :)......heres my problem

var vAppPath=(my file)
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlHttp.send("text=" +
escape(document.getElementById("tledit").value));

were document.getElementById("tledit").value = assccéccèccÉcc
d'abonnccàcc ccÀcc ccboccîccte

now in my file.....i do try to read the text
text = request("text")

the text = asscccccccc d'abonncccc cccc ccboccccte

the french characters are stripped out. I think its the escape
functions thats doing this.
is there a way to over come this?

Author
31 Aug 2006 7:35 AM
Anthony Jones
<Kavita.K.Si***@gmail.com> wrote in message
Show quote
>news:1157007487.522069.153220@m79g2000cwm.googlegroups.com...
>Hello Gurus
>thankyou for your help in advance :)......heres my problem
>
>var vAppPath=(my file)
>xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
>xmlHttp.open("POST",vAppPath,false);
>xmlHttp.setRequestHeader("Content-Type",
>"application/x-www-form-urlencoded");
>xmlHttp.send("text=" +
>escape(document.getElementById("tledit").value));
>
>were document.getElementById("tledit").value = assccéccèccÉcc
>d'abonnccàcc ccÀcc ccboccîccte
>
>now in my file.....i do try to read the text
>text = request("text")
>
>the text = asscccccccc d'abonncccc cccc ccboccccte
>
>the french characters are stripped out. I think its the escape
>functions thats doing this.
>is there a way to over come this?

Don't use the escape function use encodeURIComponent instead.
Author
31 Aug 2006 8:06 AM
Anthony Jones
Show quote
"Anthony Jones" <A**@yadayadayada.com> wrote in message
news:OkTY7$MzGHA.4308@TK2MSFTNGP03.phx.gbl...
>
> <Kavita.K.Si***@gmail.com> wrote in message
> >news:1157007487.522069.153220@m79g2000cwm.googlegroups.com...
> >Hello Gurus
> >thankyou for your help in advance :)......heres my problem
> >
> >var vAppPath=(my file)
> >xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
> >xmlHttp.open("POST",vAppPath,false);
> >xmlHttp.setRequestHeader("Content-Type",
> >"application/x-www-form-urlencoded");
> >xmlHttp.send("text=" +
> >escape(document.getElementById("tledit").value));
> >
> >were document.getElementById("tledit").value = assccéccèccÉcc
> >d'abonnccàcc ccÀcc ccboccîccte
> >
> >now in my file.....i do try to read the text
> >text = request("text")
> >
> >the text = asscccccccc d'abonncccc cccc ccboccccte
> >
> >the french characters are stripped out. I think its the escape
> >functions thats doing this.
> >is there a way to over come this?
>
> Don't use the escape function use encodeURIComponent instead.
>

An alternative worth considering is to post XML instead.

Change the client code:-

var vAppPath=(my file)
var domReq = new ActiveXObject("Microsoft.XMLDOM")
domReq.appendChild(domReq.createElement("text")).text =
document.getElementByID("tledit").value
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("POST",vAppPath,false);
xmlHttp.setRequestHeader("Content-Type","text/xml");
xmlHttp.send domReq


Now on the Server:-

Dim domReq: Set domReq = Server.CreateObject("MSXML2.DOMDocument.3.0")
domReq.async = false
domReq.load Request

text = domReq.documentElement.text
Author
1 Sep 2006 12:12 AM
Kavi
Thankyou every much Mr Jones :-D

the encodeURIComponent did the trick :)


Anthony Jones wrote:
Show quote
> "Anthony Jones" <A**@yadayadayada.com> wrote in message
> news:OkTY7$MzGHA.4308@TK2MSFTNGP03.phx.gbl...
> >
> > <Kavita.K.Si***@gmail.com> wrote in message
> > >news:1157007487.522069.153220@m79g2000cwm.googlegroups.com...
> > >Hello Gurus
> > >thankyou for your help in advance :)......heres my problem
> > >
> > >var vAppPath=(my file)
> > >xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
> > >xmlHttp.open("POST",vAppPath,false);
> > >xmlHttp.setRequestHeader("Content-Type",
> > >"application/x-www-form-urlencoded");
> > >xmlHttp.send("text=" +
> > >escape(document.getElementById("tledit").value));
> > >
> > >were document.getElementById("tledit").value = assccéccèccÉcc
> > >d'abonnccàcc ccÀcc ccboccîccte
> > >
> > >now in my file.....i do try to read the text
> > >text = request("text")
> > >
> > >the text = asscccccccc d'abonncccc cccc ccboccccte
> > >
> > >the french characters are stripped out. I think its the escape
> > >functions thats doing this.
> > >is there a way to over come this?
> >
> > Don't use the escape function use encodeURIComponent instead.
> >
>
> An alternative worth considering is to post XML instead.
>
> Change the client code:-
>
> var vAppPath=(my file)
> var domReq = new ActiveXObject("Microsoft.XMLDOM")
> domReq.appendChild(domReq.createElement("text")).text =
> document.getElementByID("tledit").value
> xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
> xmlHttp.open("POST",vAppPath,false);
> xmlHttp.setRequestHeader("Content-Type","text/xml");
> xmlHttp.send domReq
>
>
> Now on the Server:-
>
> Dim domReq: Set domReq = Server.CreateObject("MSXML2.DOMDocument.3.0")
> domReq.async = false
> domReq.load Request
>
> text = domReq.documentElement.text

AddThis Social Bookmark Button