URL encoding: Difference between revisions

Content deleted Content added
→‎{{header|AutoHotkey}}: AutoHotkey example added
Sonia (talk | contribs)
→‎{{header|Go}}: library change
Line 110: Line 110:


import (
import (
"fmt"
"fmt"
"url"
"http"
"strings"
)
)


func main() {
func main() {
url := http.URLEscape("http://foo bar/")
fmt.Println(url.QueryEscape("http://foo bar/"))
// http.URLEscape replaces ' ' with '+', so:
url = strings.Replace(url, "+", "%20", -1)
fmt.Println(url)
}</lang>
}</lang>