func GbkToUtf8(s []byte) ([]byte,error) { reader := transform.NewReader(bytes.NewReader(s),simplifiedchinese.GBK.NewDecoder()) d,e := IoUtil.ReadAll(reader) if e != nil { return nil,e } return d,nil } func Utf8ToGbk(s []byte) ([]byte,simplifiedchinese.GBK.NewEncoder()) d,nil }原文链接:https://www.f2er.com/go/188986.html