Chilkat2-Python
Chilkat2-Python
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Chilkat2-Python Downloads
import chilkat2
crypt = chilkat2.Crypt2()
s = "< é ü ç Ω Hello & World ✓ >"
htmlEncoded = crypt.EncodeString(s,"utf-8","html")
print(htmlEncoded)
# Output:
# < é ü ç Ω Hello & World ✓ >
# To decode:
s = crypt.DecodeString(htmlEncoded,"utf-8","html")
print(s)
# Output:
# < é ü ç Ω Hello & World ✓ >