string = HTMLDecode(encodedstring)
Example Usage:
ASP Source Code:<% ' use the GetWebPage function to grab some html ' use the server.htmlencode method to encode it ' and finally, decode the encoded HTML back into ' code. If it works, you see the generated html of ' the web page. %> <% = HTMLDecode( Server.HTMLEncode( _ GetWebPage( "http://www.yahoo.com/" ) ) ) %>
<% Private Function HTMLDecode(byVal encodedstring) Dim tmp, i tmp = encodedstring tmp = Replace( tmp, """, chr(34) ) tmp = Replace( tmp, "<" , chr(60) ) tmp = Replace( tmp, ">" , chr(62) ) tmp = Replace( tmp, "&" , chr(38) ) tmp = Replace( tmp, " ", chr(32) ) For i = 1 to 255 tmp = Replace( tmp, "&#" & i & ";", chr( i ) ) Next HTMLDecode = tmp End Function %>