参考代码
package main
import (
"bufio"
"fmt"
"io"
"os/exec"
"syscall"
"time"
"golang.org/x/text/encoding/simplifiedchinese"
)
type charset string
const (
UTF8 = charset("UTF-8")
GB18030 = charset("GB18030")
)
// 对字符进行转码
func ByteToString(byte []byte, charset charset) string {
var str string
switch charset {
case GB18030:
var de