From 926707f0a7a8c6c8ae236ef8fb46ae631fb7a8ef Mon Sep 17 00:00:00 2001 From: sartrey Date: Wed, 22 Jun 2016 14:55:21 +0800 Subject: [PATCH] doc: clarify child_process stdout/stderr types Clarify how the encoding option interacts with the data type of child process stdout and stderr. Fixes: https://github.com/nodejs/node/issues/6666 PR-URL: https://github.com/nodejs/node/pull/7361 Reviewed-By: Colin Ihrig --- doc/api/child_process.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index a196f99b282b8d..d519ab4b49ab26 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -164,8 +164,8 @@ The `stdout` and `stderr` arguments passed to the callback will contain the stdout and stderr output of the child process. By default, Node.js will decode the output as UTF-8 and pass strings to the callback. The `encoding` option can be used to specify the character encoding used to decode the stdout and -stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to -the callback instead. +stderr output. If `encoding` is `'buffer'`, or an unrecognized character +encoding, `Buffer` objects will be passed to the callback instead. The `options` argument may be passed as the second argument to customize how the process is spawned. The default options are: @@ -233,8 +233,8 @@ The `stdout` and `stderr` arguments passed to the callback will contain the stdout and stderr output of the child process. By default, Node.js will decode the output as UTF-8 and pass strings to the callback. The `encoding` option can be used to specify the character encoding used to decode the stdout and -stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to -the callback instead. +stderr output. If `encoding` is `'buffer'`, or an unrecognized character +encoding, `Buffer` objects will be passed to the callback instead. ### child_process.fork(modulePath[, args][, options])