Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created April 7, 2013 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/5332979 to your computer and use it in GitHub Desktop.
Save isaacs/5332979 to your computer and use it in GitHub Desktop.
diff --git a/lib/net.js b/lib/net.js
index 4b2622b..3c58de2 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment