简单的字符串编码可以使用下面方式

    str := "aabb,&8?%s"
    ret := url.QueryEscape(str)
    log.Println(ret)

    encodedValue := "Hell%C3%B6+W%C3%B6rld%40Golang"
    decodedValue, err := url.QueryUnescape(encodedValue)
    log.Println(decodedValue, err)

输出结果

2021/08/14 11:35:12 aabb%2C%268%3F%25s
2021/08/14 11:35:13 Hellö Wörld@Golang <nil>

 

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案