golang之UrlEncode编码/UrlDecode解码


package main

import(
"fmt"
"net/url"
)

func main() {
var urlStr string = "傻了吧:%:%@163& .html.html"
escapeUrl := url.QueryEscape(urlStr)
fmt.Println("编码:",escapeUrl)

enEscapeUrl, _ := url.QueryUnescape(escapeUrl)
fmt.Println("解码:",enEscapeUrl)
}

Comments are closed.

Post Navigation