Sample code for 30+ languages & platforms
Lianja

HTML Entity Encode and Decode in StringBuilder

Demonstrates HTML encoding and decoding the contents of a StringBuilder.

Chilkat Lianja Downloads

Lianja
loSb = createobject("CkStringBuilder")

s = "< é ü ç Ω Hello & World ✓ >"
loSb.Append(s)

loSb.Encode("html","utf-8")
? loSb.GetAsString()

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

// To decode:
loSb.Decode("html","utf-8")
? loSb.GetAsString()

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


release loSb