A Urldecode function does not exist to the best of my knowledge. Here is a customized function to do what I think you want to do...
***************************************************************** Function URLDecode(ByVal What) 'URL decode Function '2001 Antonin Foller, PSTRUH Software, http://www.pstruh.cz Dim Pos, pPos 'replace + To Space What = Replace(What, "+", " ") on error resume Next Dim Stream: Set Stream = CreateObject("ADODB.Stream") If err = 0 Then 'URLDecode using ADODB.Stream, If possible on error goto 0 Stream.Type = 2 'String Stream.Open 'replace all %XX To character Pos = InStr(1, What, "%") pPos = 1 Do While Pos > 0 Stream.WriteText Mid(What, pPos, Pos - pPos) + _ Chr(CLng("&H" & Mid(What, Pos + 1, 2))) pPos = Pos + 3 Pos = InStr(pPos, What, "%") Loop Stream.WriteText Mid(What, pPos) 'Read the text stream Stream.Position = 0 URLDecode = Stream.ReadText 'Free resources Stream.Close Else 'URL decode using string concentation on error goto 0 'UfUf, this is a little slow method. 'Do Not use it For data length over 100k Pos = InStr(1, What, "%") Do While Pos>0 What = Left(What, Pos-1) + _ Chr(Clng("&H" & Mid(What, Pos+1, 2))) + _ Mid(What, Pos+3) Pos = InStr(Pos+1, What, "%") Loop URLDecode = What End If End Function ******************************************************************* -----Original Message----- From: Robert Swiger [mailto:rswiger@;tcrh.org] Sent: Wednesday, October 30, 2002 11:20 AM To: ActiveServerPages Subject: URLDecode How do I use URLDecode? Each time I used it, after using URLEncode, I get an error: Microsoft VBScript runtime error '800a000d' Type mismatch: 'urldecode' functions.inc, line 161 I have tried using server.urldecode(string), string.urldecode(string) and urldecode(string) and get an error each time. Please help. Rob Swiger Webmaster TCRHonline - Where People Care Twin County Regional Healthcare 200 Hospital Drive Galax, Virginia 24333 (276) 238-3515 PHONE (276) 236-2660 FAX http://www.tcrh.org [EMAIL PROTECTED] GO HOKIES!!! Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
