Tcl
Tcl
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Tcl Downloads
load ./chilkat.dll
set sb [new_CkStringBuilder]
set s "< é ü ç Ω Hello & World ✓ >"
CkStringBuilder_Append $sb $s
CkStringBuilder_Encode $sb "html" "utf-8"
puts [CkStringBuilder_getAsString $sb]
# Output:
# < é ü ç Ω Hello & World ✓ >
# To decode:
CkStringBuilder_Decode $sb "html" "utf-8"
puts [CkStringBuilder_getAsString $sb]
# Output:
# < é ü ç Ω Hello & World ✓ >
delete_CkStringBuilder $sb