backup-x icon indicating copy to clipboard operation
backup-x copied to clipboard

中文字符乱码的问题

Open Beautiful-blue-sky opened this issue 2 years ago • 1 comments

如果备份脚本里有涉及中文字符,会有乱码的情况,导致无法执行成功 image 我在Client里的backup.go文件中,shellString写入前进行了GBK转码,就能正常执行

encoder := simplifiedchinese.GBK.NewEncoder()
shellString, err = encoder.String(shellString)

image 另外还有个问题,shell.CombinedOutput()这段代码,获取的内容,中文字符会变成x开头的字符 image

Beautiful-blue-sky avatar Dec 24 '23 10:12 Beautiful-blue-sky

欢迎PR,需要注意兼容其他系统

jeessy2 avatar Dec 24 '23 11:12 jeessy2