From 639fbe28d11fa9d75aa1531930b1e73d7b3a1e77 Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 2 Oct 2012 16:28:02 -0700 Subject: [PATCH] streams2: Convert strings to buffers before passing to _write() --- lib/_stream_writable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index e2343e63f9c..fd0cd115b4c 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -65,7 +65,7 @@ Writable.prototype.write = function(chunk, encoding) { return; } - if (typeof chunk === 'string' && encoding) + if (typeof chunk === 'string') chunk = new Buffer(chunk, encoding); var ret = state.length >= state.highWaterMark;