mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-30 04:42:45 +08:00
pythonc编码设置
This commit is contained in:
parent
d659fdcc88
commit
f580660ac7
@ -194,11 +194,13 @@ window.temporaryStoreSoldOut = () => {
|
|||||||
// python -c
|
// python -c
|
||||||
window.runPythonCommand = py => {
|
window.runPythonCommand = py => {
|
||||||
try {
|
try {
|
||||||
return child_process.execFileSync("python", ["-c", py], {
|
let result = child_process.execFileSync("python", ["-c", py], {
|
||||||
windowsHide: true,
|
windowsHide: true,
|
||||||
|
encoding: 'buffer'
|
||||||
})
|
})
|
||||||
|
return iconv.decode(result, utools.isWindows() ? 'gbk' : 'utf8').trim()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
utools.showNotification(e)
|
alert(e)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user