Problems with sending an encoded url

Discussion in 'ASP General' started by Kavita.K.Singh@gmail.com, Aug 31, 2006.

  1. Guest

    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?
    , Aug 31, 2006
    #1
    1. Advertising

  2. <> wrote in message
    >news:...
    >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.
    Anthony Jones, Aug 31, 2006
    #2
    1. Advertising

  3. "Anthony Jones" <> wrote in message
    news:OkTY7$...
    >
    > <> wrote in message
    > >news:...
    > >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
    Anthony Jones, Aug 31, 2006
    #3
  4. Kavi Guest

    Thankyou every much Mr Jones :-D

    the encodeURIComponent did the trick :)


    Anthony Jones wrote:
    > "Anthony Jones" <> wrote in message
    > news:OkTY7$...
    > >
    > > <> wrote in message
    > > >news:...
    > > >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
    Kavi, Sep 1, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Amada

    URL Decode HTML encoded in JavaScript

    Ben Amada, Sep 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    17,837
    Ben Amada
    Sep 30, 2005
  2. Ben Amada

    URL encoded text automatically decoded?

    Ben Amada, Oct 3, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,111
    Mr Newbie
    Oct 4, 2005
  3. Andrew James
    Replies:
    1
    Views:
    225
    Dieter Maurer
    Nov 20, 2004
  4. =?iso-8859-1?B?RnJhbudvaXM=?=

    Ahhh.. URL wants to get encoded. Does Java wanna?

    =?iso-8859-1?B?RnJhbudvaXM=?=, Nov 6, 2007, in forum: Java
    Replies:
    11
    Views:
    8,355
    Owen Jacobson
    Nov 6, 2007
  5. Pugi!
    Replies:
    6
    Views:
    287
    David Mark
    Jan 12, 2008
Loading...

Share This Page