Sample code for 30+ languages & platforms
Delphi ActiveX Requires Chilkat v11.1.0+

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
var
crypt: TChilkatCrypt2;
s: WideString;
htmlEncoded: WideString;

begin
crypt := TChilkatCrypt2.Create(Self);

s := '< é ü ç Ω Hello & World ✓ >';

htmlEncoded := crypt.EncodeString(s,'utf-8','html');
Memo1.Lines.Add(htmlEncoded);

//  Output:
//  < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

//  To decode:
s := crypt.DecodeString(htmlEncoded,'utf-8','html');
Memo1.Lines.Add(s);

//  Output:
//  < é ü ç Ω Hello & World ✓ >