From 4fb2a44d7463e34c54a6f85461142de3ee9a9e91 Mon Sep 17 00:00:00 2001 From: dceejay Date: Wed, 7 Jan 2015 21:33:15 +0000 Subject: [PATCH] correct exec binary stdout to be consistent with spawn stdout. Binary = buffer String = utf8 --- nodes/core/core/75-exec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes/core/core/75-exec.js b/nodes/core/core/75-exec.js index a56c3f15b..ba8849973 100644 --- a/nodes/core/core/75-exec.js +++ b/nodes/core/core/75-exec.js @@ -67,7 +67,8 @@ module.exports = function(RED) { var cl = node.cmd+" "+msg.payload+" "+node.append; if (RED.settings.verbose) { node.log(cl); } var child = exec(cl, {encoding: 'binary'}, function (error, stdout, stderr) { - msg.payload = stdout; + msg.payload = new Buffer(stdout); + if (isUtf8(msg.payload)) { msg.payload = msg.payload.toString(); } var msg2 = {payload:stderr}; var msg3 = null; //console.log('[exec] stdout: ' + stdout);