mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fixed bug with cp866 charset on windows
This commit is contained in:
parent
61764f668e
commit
5e152c6b37
1 changed files with 4 additions and 10 deletions
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
var io = require('socket.io'),
|
||||
exec = require('child_process').exec,
|
||||
Socket = {},
|
||||
Win32_b = false;
|
||||
|
||||
if(process.platform === 'win32')
|
||||
Win32_b = true;
|
||||
Socket = {};
|
||||
|
||||
/**
|
||||
* Function listen on servers port
|
||||
|
|
@ -38,16 +34,14 @@ exports.listen = function(pServer){
|
|||
* @param stderr
|
||||
*/
|
||||
function getExec(error, stdout, stderr) {
|
||||
if(stdout){
|
||||
if(Win32_b)
|
||||
stdout = stdout.toString('utf-8');
|
||||
if(stdout){
|
||||
stdout = stdout.toString('utf-8');
|
||||
|
||||
console.log(stdout);
|
||||
Socket.send(stdout);
|
||||
}
|
||||
if(stderr){
|
||||
if(Win32_b)
|
||||
stderr = stderr.toString('utf-8');
|
||||
stderr = stderr.toString('utf-8');
|
||||
|
||||
console.log('stderr: ' + stderr);
|
||||
Socket.send(stderr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue