IrcChannel = require('./channel.js'),
IrcUser = require('./user.js'),
EE = require('../ee.js'),
+ iconv = require('iconv-lite'),
Socks;
socketConnectHandler.call(that);
});
- this.socket.setEncoding('utf-8');
-
this.socket.on('error', function (event) {
that.emit('error', event);
});
* Write a line of data to the IRCd
*/
IrcConnection.prototype.write = function (data, callback) {
- this.socket.write(data + '\r\n', 'utf-8', callback);
+ //ENCODE string to encoding of the server
+ encoded_buffer = iconv.encode(data + '\r\n', "windows-1252");
+ this.socket.write(encoded_buffer);
};
tags = [],
tag;
+ //DECODE server encoding
+ data = iconv.decode(data, 'windows-1252');
+ console.log(data);
if (this.hold_last && this.held_data !== '') {
data = this.held_data + data;
this.hold_last = false;
this.held_data = data[i];
break;
}
-
+
// Parse the complete line, removing any carriage returns
msg = parse_regex.exec(data[i].replace(/^\r+|\r+$/, ''));