Server.HTMLDecode

Discussion in 'ASP General' started by b.Wurm, Jun 7, 2005.

  1. b.Wurm

    b.Wurm Guest

    how can I write a server.htmlDecode function?

    thank you
     
    b.Wurm, Jun 7, 2005
    #1
    1. Advertisements

  2. b.Wurm

    Steven Burn Guest

    Function URLDecode(sDec)
    dim objRE
    set objRE = new RegExp
    sDec = Replace(sDec, "+", " ")
    objRE.Pattern = "%([0-9a-fA-F]{2})"
    objRE.Global = True
    URLDecode = objRE.Replace(sDec, GetRef("URLDecodeHex"))
    End Function

    '// Replacement function for the above
    Function URLDecodeHex(sMatch, lhex_digits, lpos, ssource)
    URLDecodeHex = chr("&H" & lhex_digits)
    End Function

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!
     
    Steven Burn, Jun 7, 2005
    #2
    1. Advertisements

  3. b.Wurm

    McKirahan Guest

    McKirahan, Jun 7, 2005
    #3
  4. b.Wurm

    Steven Burn Guest

    My apologies (C&P'd to a local file a while ago, but didn't bookmark the URL I got it from)

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!
     
    Steven Burn, Jun 7, 2005
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.