Go
Go
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Go Downloads
crypt := chilkat.NewCrypt2()
var s *string = new(string)
*s = "< é ü ç Ω Hello & World ✓ >"
htmlEncoded := crypt.EncodeString(*s,"utf-8","html")
fmt.Println(*htmlEncoded)
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = crypt.DecodeString(*htmlEncoded,"utf-8","html")
fmt.Println(*s)
// Output:
// < é ü ç Ω Hello & World ✓ >
crypt.DisposeCrypt2()