urldecode

T

Thomas Henz

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
 
C

Chris Hohmann

Thomas Henz said:
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

There no such animal as Server.URLDecode. You will need to roll your
own. Perhaps using regular expression.
 
P

Pappas Mike

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top