urldecode

Discussion in 'ASP General' started by Thomas Henz, Aug 22, 2003.

  1. Thomas Henz

    Thomas Henz Guest

    Hi again,

    can anyone tell me why it says that the object doesnt support this method?

    rs is a db query resultset.
    msg is a db field with urlencoded data in it.
    ------------
    if not rs.eof then
    do while not rs.eof
    response.write(server.urldecode(rs("msg")))
    rs.movenext
    loop
    end if
    ----------------

    Thanks a lot,
    Tom
     
    Thomas Henz, Aug 22, 2003
    #1
    1. Advertising

  2. "Thomas Henz" <> wrote in message
    news:bi5hag$4b2$06$-online.com...
    > Hi again,
    >
    > can anyone tell me why it says that the object doesnt support this

    method?
    >
    > rs is a db query resultset.
    > msg is a db field with urlencoded data in it.
    > ------------
    > if not rs.eof then
    > do while not rs.eof
    > response.write(server.urldecode(rs("msg")))
    > rs.movenext
    > loop
    > end if
    > ----------------
    >
    > Thanks a lot,
    > Tom
    >


    There no such animal as Server.URLDecode. You will need to roll your
    own. Perhaps using regular expression.
     
    Chris Hohmann, Aug 22, 2003
    #2
    1. Advertising

  3. Thomas Henz

    Pappas Mike Guest

    Url decode is not supported because it is done automaticaly when you pass an
    encoded string in a querystring.
    If you wish to read an encoded string from somewhere else than
    request.querystring you have to implement a decode function like the
    following:

    function URLDecode(sText)
    sDecoded = sText
    Set oRegExpr = Server.CreateObject("VBScript.RegExp")
    oRegExpr.Pattern = "%[0-9,A-F]{2}"
    oRegExpr.Global = True
    Set oMatchCollection = oRegExpr.Execute(sText)
    For Each oMatch In oMatchCollection
    sDecoded = Replace(sDecoded,oMatch.value,Chr(CInt("&H" &
    Right(oMatch.Value,2))))
    Next
    URLDecode = sDecoded
    End function
     
    Pappas Mike, Aug 22, 2003
    #3
    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. John Hoge
    Replies:
    4
    Views:
    3,958
    John Hoge
    Jul 26, 2004
  2. Lloyd Sheen

    Problem with Web.HttpUtility.UrlDecode

    Lloyd Sheen, Mar 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,826
    Lloyd Sheen
    Mar 2, 2005
  3. =?Utf-8?B?bWF2cmljazEwMQ==?=

    UrlDecode !!! retrieving querystring from an 'escaped' url

    =?Utf-8?B?bWF2cmljazEwMQ==?=, Apr 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,761
    =?Utf-8?B?bWF2cmljazEwMQ==?=
    Apr 22, 2005
  4. John Grandy

    Request.QueryString and Server.URLDecode()

    John Grandy, Aug 13, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    26,180
    Lucas Tam
    Aug 17, 2005
  5. gert

    urlDecode()

    gert, Feb 28, 2007, in forum: Python
    Replies:
    4
    Views:
    771
Loading...

Share This Page