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);