From 71528a759baff95c9466274230d98b7cc404bcef Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Fri, 23 May 2014 15:57:52 +0200 Subject: [PATCH] Make stream conversion possible to other encoding Converting buffers to other encodings than utf-8 is impossible if you already encode it right after receiving the chunk. I for example read a lot of articles encoded in ISO-8859-1 which I cannot convert (with node-iconv) to UTF-8 anymore. --- lib/nntp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nntp.js b/lib/nntp.js index 939afab..0281a97 100644 --- a/lib/nntp.js +++ b/lib/nntp.js @@ -277,7 +277,7 @@ NNTP.prototype.connect = function(options) { if (isErr || !chunk) return; if (self._stream === undefined) - self._buffer += chunk.toString(self._bufferEnc || 'utf8', start, end); + self._buffer += chunk.toString(self._bufferEnc || 'binary', start, end); else self._stream.emit('data', chunk.slice(start, end)); }