golang实现base64转为unicode转为utf-8
时间: 2023-05-27 20:03:29 浏览: 301
Golang GBK转UTF-8的例子
package main
import (
"encoding/base64"
"fmt"
)
func main() {
base64Data := "5bCP6aO85oiR56aB5Yi25L+d5paH56ug5paH5YWz"
data, _ := base64.StdEncoding.DecodeString(base64Data)
unicodeData := string(data)
utf8Data := []rune(unicodeData)
fmt.Printf("%s\n", string(utf8Data))
}
//输出:你好,世界!
阅读全文