Index of Functions
------------------
1: HTMLDecode
Function Name ( 1): HTMLDecode
--------------------------------------------------------------------------------
'Date Created: 10-Nov-2009 10:44:21 PM
'Last Updated: 11-Nov-2009 10:45:05 PM
'Created By : Ira J. Perlow
'Updated By : Ira J. Perlow
FUNCTION HTMLDecode AS C (input="" as A)
'DESCRIPTION: Decodes HTML encoded text to regular text
'LIMITATIONS:X
'==============================================================================
' Created by Computer Systems Design & Associates
' Copyright 2001-2009 Computer Systems Design & Associates, All Rights Reserved
' http://www.csda1.com
'
' You may use this code at your own risk in whole or as a part.
'
' Use in full or part in operational code is permitted with proper
' attributions to the source, and preserving the Copyrights and this section
' except it may not be sold as part of any software package that includes a
' library of functions as a primary use of the software package.
'
' Use in instructional materials is permitted if provided without modification as source
'
' 100x faster version with option to convert to plain ASCII is available for purchase
'==============================================================================
' HTMLDecode - Version 1.01 Release Date: 20091111
'
' Syntax
'
' Purpose: Converts HTML encoded Text to regular text
'
' Input:
' Input - Input text to convert
'
' Output (Return Value): Decoded HTML string
'
' Errors:
'
' Typical Usage:
'
' Examples:
' HTMLDecode("")
'
' Notes:
' Numeric character references have one of the following forms:
' nnn; where nnn specifies a decimal number that contains one or more digits.
' nnn; where nnn specifies a hexadecimal number that contains one or more digits.
'======================================================================
Dim tmp as c
tmp=stritran(stritran(stritran(stritran(stritran(stritran(stritran(\
input,"+"," "),""","\""),"<","<"),">",">"),"&","&")," "," "),"'","'")
dim i as n
For i=1 to 255
tmp=stritran(tmp,""+ltrim(str(i))+";",chr(i))
tmp=stritran(tmp,""+ltrim(str(dec_to_hex(i)))+";",chr(i))
tmp=stritran(tmp,""+padl(ltrim(str(i)),3,"0")+";",chr(i))
tmp=stritran(tmp,""+padl(ltrim(str(i)),2,"0")+";",chr(i))
IF i<100
tmp=stritran(tmp,""+padl(ltrim(str(i)),2,"0")+";",chr(i))
END IF
IF i<16
tmp=stritran(tmp,""+padl(ltrim(str(dec_to_hex(i))),2,"0")+";",chr(i))
END IF
Next
HTMLDecode = tmp
END FUNCTION
End Function ( 1)---------------------------------------------------------------