Well as the title sais, this is a html encoder. I know it's not 100% correct atm, but it's a start.
Usage:
$htmlencode(html goes here)
alias htmlencode {
var %str = $replace($1-,&,&,<,<,>,>)
var %str = $regsubex(%str,/&#(\d+?);/g,$chr(\1))
var %str = $regsubex(%str,/&#x([\dA-F][\dA-F]);/g,$chr($base(\1,16,10)))
return %str
}