From ff32ecd5bf32a3e2d1a3b3c6b7b12f640a8ea341 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Mon, 8 Apr 2013 11:48:46 +0400 Subject: [PATCH] net: account encoding in .byteLength --- lib/net.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 4b2622be0db..3c58de2837b 100644 --- a/lib/net.js +++ b/lib/net.js @@ -667,7 +667,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() { encoding = this._pendingEncoding; state.buffer.forEach(function(el) { - bytes += Buffer.byteLength(el.chunk); + bytes += Buffer.byteLength(el.chunk, el.encoding); }); if (data)