PHP
·
发表于 5年以前
·
阅读量:8281
package encoding
import (
"gopkg.in/iconv.v1"
)
func ConvString(from, to, content string) (string, error) {
cd, err := iconv.Open(to, from)
if err != nil {
return "", err
}
defer cd.Close()
gbk := cd.ConvString(content)
return gbk, nil
}