Sample code for 30+ languages & platforms
Go

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat Go Downloads

Go
    http := chilkat.NewHttp()

    s := "Hello World! 100% sure."

    encoded := http.UrlEncode(s)
    fmt.Println("URL encoded: ", *encoded)

    // Space → %20
    // ! → %21
    // % → %25

    decoded := http.UrlDecode(*encoded)
    fmt.Println("URL decoded: ", *decoded)

    // Output:

    // URL encoded: Hello%20World%21%20100%25%20sure.
    // URL decoded: Hello World! 100% sure.

    http.DisposeHttp()