Chilkat2-Python
Chilkat2-Python
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Chilkat2-Python Downloads
import chilkat2
sb = chilkat2.StringBuilder()
s = "< é ü ç Ω Hello & World ✓ >"
sb.Append(s)
sb.Encode("html","utf-8")
print(sb.GetAsString())
# Output:
# < é ü ç Ω Hello & World ✓ >
# To decode:
sb.Decode("html","utf-8")
print(sb.GetAsString())
# Output:
# < é ü ç Ω Hello & World ✓ >