Skip to content

Commit e28e1af

Browse files
committed
fix: force utf8 encoding in execProcess to guarantee string output
1 parent 6b91d5d commit e28e1af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/childProcess.apis.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export async function execProcess(command: string, options?: cp.ExecOptions): Pr
2424
PYTHONUTF8: '1',
2525
...(options?.env ?? process.env),
2626
};
27-
const result = await cpExec(command, { ...options, env });
27+
// Force encoding: 'utf8' to guarantee string output (cp.exec can return Buffers otherwise)
28+
const result = await cpExec(command, { ...options, env, encoding: 'utf8' });
2829
return {
2930
stdout: result.stdout ?? '',
3031
stderr: result.stderr ?? '',

0 commit comments

Comments
 (0)