Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

中文字符乱码的问题 #100

Open
lantian250 opened this issue Dec 24, 2023 · 1 comment
Open

中文字符乱码的问题 #100

lantian250 opened this issue Dec 24, 2023 · 1 comment

Comments

@lantian250
Copy link

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

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

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

@jeessy2
Copy link
Owner

jeessy2 commented Dec 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants