* Couple more toString() -> decode() updates
This commit is contained in:
parent
46088a9f02
commit
f318dc8da2
|
@ -99,7 +99,6 @@ function initialize(cb) {
|
|||
});
|
||||
|
||||
// Init some extensions
|
||||
require('iconv-lite').extendNodeEncodings();
|
||||
require('string-format').extend(String.prototype, require('./string_util.js').stringFormatExtensions);
|
||||
|
||||
callback(null);
|
||||
|
|
|
@ -10,8 +10,6 @@ var iconv = require('iconv-lite');
|
|||
var assert = require('assert');
|
||||
var _ = require('lodash');
|
||||
|
||||
//iconv.extendNodeEncodings();
|
||||
|
||||
exports.ClientTerminal = ClientTerminal;
|
||||
|
||||
function ClientTerminal(output) {
|
||||
|
|
|
@ -9,6 +9,7 @@ var assert = require('assert');
|
|||
var binary = require('binary');
|
||||
var fs = require('fs');
|
||||
var util = require('util');
|
||||
var iconv = require('iconv-lite');
|
||||
|
||||
// :TODO: Remove "Ftn" from most of these -- it's implied in the module
|
||||
exports.stringFromFTN = stringFromFTN;
|
||||
|
@ -29,7 +30,7 @@ function stringFromFTN(buf, encoding) {
|
|||
}
|
||||
}
|
||||
|
||||
return buf.slice(0, nullPos).toString(encoding || 'utf-8');
|
||||
return iconv.decode(buf.slice(0, nullPos), encoding || 'utf-8');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ var userLogin = require('./user_login.js').userLogin;
|
|||
|
||||
var async = require('async');
|
||||
var _ = require('lodash');
|
||||
var iconv = require('iconv-lite');
|
||||
|
||||
exports.login = login;
|
||||
exports.logoff = logoff;
|
||||
|
@ -66,7 +67,7 @@ function logoff(callingMenu, formData, extraArgs) {
|
|||
//
|
||||
client.term.write(
|
||||
ansi.normal() + '\n' +
|
||||
require('crypto').randomBytes(Math.floor(Math.random() * 65) + 20).toString(client.term.outputEncoding) +
|
||||
iconv.decode(require('crypto').randomBytes(Math.floor(Math.random() * 65) + 20), client.term.outputEncoding) +
|
||||
'NO CARRIER');
|
||||
|
||||
client.end();
|
||||
|
|
Loading…
Reference in New Issue