Sample code for 30+ languages & platforms
C#

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat C# Downloads

C#
Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

string s = "< é ü ç Ω Hello & World ✓ >";

string htmlEncoded = crypt.EncodeString(s,"utf-8","html");
Debug.WriteLine(htmlEncoded);

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

//  To decode:
s = crypt.DecodeString(htmlEncoded,"utf-8","html");
Debug.WriteLine(s);

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