Sample code for 30+ languages & platforms
Go

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat Go Downloads

Go
    crypt := chilkat.NewCrypt2()

    var s *string = new(string)
    *s = "< é ü ç Ω Hello & World ✓ >"

    htmlEncoded := crypt.EncodeString(*s,"utf-8","html")
    fmt.Println(*htmlEncoded)

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

    // To decode:
    s = crypt.DecodeString(*htmlEncoded,"utf-8","html")
    fmt.Println(*s)

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

    crypt.DisposeCrypt2()