From 274e7cca15026dd8da230e18baf58962bf206b98 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 21 Sep 2012 07:48:46 -0400 Subject: [PATCH] minor changes --- lib/server/socket.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/server/socket.js b/lib/server/socket.js index cedba35a..a88b6e93 100644 --- a/lib/server/socket.js +++ b/lib/server/socket.js @@ -40,14 +40,14 @@ exports.listen = function(pServer){ function getExec(error, stdout, stderr) { if(stdout){ if(Win32_b) - stdout = win2unicode(stdout); + stdout = win2unicode2(stdout); console.log(stdout); Socket.send(stdout); } if(stderr){ if(Win32_b) - stderr = win2unicode(stderr); + stderr = win2unicode2(stderr); console.log('stderr: ' + stderr); Socket.send(stderr); @@ -70,4 +70,26 @@ function win2unicode(bytes) { for (var i= 0; i= 0xC0 && code <= 0xFF) return String.fromCharCode(code - 0xC0 + 0x0410) + if(code >= 0x80 && code <= 0xBF) return charmap.charAt(code - 0x80) + return String.fromCharCode(code) + } + var res = "" + for(var i = 0; i < str.length; i++) res = res + code2char(str.charCodeAt(i)) + return res } \ No newline at end of file