shell: set utf8 encoding explicity for spawn and as the default for sudo

This commit is contained in:
Girish Ramakrishnan
2025-10-13 10:32:08 +02:00
parent 36d443fa36
commit 45d68c4da8
5 changed files with 14 additions and 12 deletions
+2
View File
@@ -152,6 +152,8 @@ async function sudo(tag, args, options) {
options.stdio = ['pipe', 'pipe', 'pipe', 'ipc'];
}
if (!options.encoding) options.encoding = 'utf8'; // better error message output
const spawnArgs = [ ...sudoArgs, ...args ];
return await spawn(tag, SUDO, spawnArgs, options);
}