提交 2c843226 编写于 作者: J Joao Moreno

git lib: use iconv to decode buffers

fixes #1539
上级 513b5dfe
......@@ -44,12 +44,12 @@ function exec(child: ChildProcess, encoding = 'utf8'): TPromise<IExecutionResult
new TPromise<string>(c => {
let buffers: Buffer[] = [];
on(child.stdout, 'data', b => buffers.push(b));
once(child.stdout, 'close', () => c(Buffer.concat(buffers).toString(encoding)));
once(child.stdout, 'close', () => c(iconv.decode(Buffer.concat(buffers), encoding)));
}),
new TPromise<string>(c => {
let buffers: Buffer[] = [];
on(child.stderr, 'data', b => buffers.push(b));
once(child.stderr, 'close', () => c(Buffer.concat(buffers).toString(encoding)));
once(child.stderr, 'close', () => c(iconv.decode(Buffer.concat(buffers), encoding)));
})
]).then(values => {
disposeAll(disposables);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册