468,719 Members | 1,798 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,719 developers. It's quick & easy.

urldecode

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

Jul 19 '05 #1
2 30873
"Thomas Henz" <th***@t-online.de> wrote in message
news:bi*************@news.t-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.
Jul 19 '05 #2
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

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Yifan | last post: by
1 post views Thread by Joăo Santa Bárbara | last post: by
5 posts views Thread by Yifan | last post: by
4 posts views Thread by John Hoge | last post: by
6 posts views Thread by John Grandy | last post: by
10 posts views Thread by Alex | last post: by
1 post views Thread by fjm67 | last post: by
3 posts views Thread by gert | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.