- 编码转换
github.com/axgle/mahonia
示例:
func ConvertGBKToUTF8(str string) string {
dec := mahonia.NewDecoder("GBK")
return dec.ConvertString(str)
}
func ConvertUTF8ToGBK(str string) string {
enc := mahonia.NewEncoder("GBK")
return enc.ConvertString(str)
}