var child = require('child_process').exec;
var fs = require('fs');
var son = child('dir', function(err,stdout,stderr){});
var w = fs.createWriteStream('e:\\lab\\pipe.txt', {encoding:'utf8'});
son.stdout.setEncoding('utf8');
son.stdout.pipe(w);
打开pipe.txt, 中文都是乱码