child_process: fix exec set stdout.setEncoding
cp.exec decide to use `_stdout`(_stdout is string) or `Buffer.concat(_stdout)`(_stdout is buffer array) by options.encoding. but std(out|err) encoding can be changed. If encoding is changed to not null, `_stdout` will become string, and `Buffer.concat(_stdout)` will throw TypeError. This patch will fix it, use options.encoding and `std(out|err)._readableState.encoding`. PR-URL: https://github.com/nodejs/node/pull/18976 Fixes: https://github.com/nodejs/node/issues/18969 Reviewed-By:Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de>
parent
913a7893
Please register or sign in to comment