Sample code for 30+ languages & platforms
AutoIt

HTML Entity Encode and Decode in StringBuilder

Demonstrates HTML encoding and decoding the contents of a StringBuilder.

Chilkat AutoIt Downloads

AutoIt
$oSb = ObjCreate("Chilkat.StringBuilder")

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

$oSb.Encode("html","utf-8")
ConsoleWrite($oSb.GetAsString() & @CRLF)

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

; To decode:
$oSb.Decode("html","utf-8")
ConsoleWrite($oSb.GetAsString() & @CRLF)

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