Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > urldecode

Reply
Thread Tools

urldecode

 
 
Thomas Henz
Guest
Posts: n/a
 
      08-22-2003
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

 
Reply With Quote
 
 
 
 
Chris Hohmann
Guest
Posts: n/a
 
      08-22-2003
"Thomas Henz" <(E-Mail Removed)> wrote in message
news:bi5hag$4b2$06$(E-Mail Removed)-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.


 
Reply With Quote
 
 
 
 
Pappas Mike
Guest
Posts: n/a
 
      08-22-2003
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
urlDecode() gert Python 4 03-02-2007 05:12 AM
Request.QueryString and Server.URLDecode() John Grandy ASP .Net 6 08-17-2005 08:25 PM
UrlDecode !!! retrieving querystring from an 'escaped' url =?Utf-8?B?bWF2cmljazEwMQ==?= ASP .Net 2 04-22-2005 01:26 PM
Problem with Web.HttpUtility.UrlDecode Lloyd Sheen ASP .Net 2 03-02-2005 10:27 AM
Server.UrlDecode from console application John Hoge ASP .Net 4 07-26-2004 02:39 PM



Advertisments