|
@ -9,7 +9,7 @@ function debug (x) { |
|
|
|
|
|
|
|
|
var sys = require('sys'); |
|
|
var sys = require('sys'); |
|
|
var net = require('net'); |
|
|
var net = require('net'); |
|
|
var Utf8Stream = require('utf8_stream').Utf8Stream; |
|
|
var Utf8Decoder = require('utf8decoder').Utf8Decoder; |
|
|
var events = require('events'); |
|
|
var events = require('events'); |
|
|
var Buffer = require('buffer').Buffer; |
|
|
var Buffer = require('buffer').Buffer; |
|
|
|
|
|
|
|
@ -202,7 +202,7 @@ IncomingMessage.prototype.setEncoding = function (enc) { |
|
|
// TODO check values, error out on bad, and deprecation message?
|
|
|
// TODO check values, error out on bad, and deprecation message?
|
|
|
this._encoding = enc.toLowerCase(); |
|
|
this._encoding = enc.toLowerCase(); |
|
|
if (this._encoding == 'utf-8' || this._encoding == 'utf8') { |
|
|
if (this._encoding == 'utf-8' || this._encoding == 'utf8') { |
|
|
this._decoder = new Utf8Stream(); |
|
|
this._decoder = new Utf8Decoder(); |
|
|
this._decoder.onString = function(str) { |
|
|
this._decoder.onString = function(str) { |
|
|
this.emit('data', str); |
|
|
this.emit('data', str); |
|
|
}; |
|
|
}; |
|
|