pythonc编码设置

This commit is contained in:
fofolee 2022-04-13 17:26:33 +08:00
parent d659fdcc88
commit f580660ac7

View File

@ -194,11 +194,13 @@ window.temporaryStoreSoldOut = () => {
// python -c
window.runPythonCommand = py => {
try {
return child_process.execFileSync("python", ["-c", py], {
let result = child_process.execFileSync("python", ["-c", py], {
windowsHide: true,
encoding: 'buffer'
})
return iconv.decode(result, utools.isWindows() ? 'gbk' : 'utf8').trim()
} catch (e) {
utools.showNotification(e)
alert(e)
return ""
}
}