Ahh, the importance of correct terminology :-)
In htmlelements.pas, there are two routines. EscapeHTML and UnescapeHTML. Will either of these cover your needs? Hmmm, they don't cover all non-printing characters :-(
function EscapeHTML ( const S : String ) : String;
begin
// ' does not work on all versions of ie, so do not use it.
Result := StringsReplace(s,['&','<','>','"',#39],['&','<','>','"','''],[rfReplaceAll]);
end;
function UnescapeHTML ( const S : String ) : String;
begin
Result := StringsReplace(result,['&','<','>','"',''','''],['&','<','>','"',#39,#39],[rfReplaceAll]);
end;
I'll keep looking...