From 482d0ed1af4d93d3a8ce200887880c41f74b4c6b Mon Sep 17 00:00:00 2001 From: Antony Clarke Date: Fri, 26 Aug 2011 03:25:52 +0200 Subject: [PATCH] Make the encoding option case insensitive when writing to a socket --- lib/net_legacy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/net_legacy.js b/lib/net_legacy.js index d9c47ba0352..0ddf97857cc 100644 --- a/lib/net_legacy.js +++ b/lib/net_legacy.js @@ -411,6 +411,11 @@ Socket.prototype._writeOut = function(data, encoding, fd, cb) { pool = null; allocNewPool(); } + + if (encoding) + { + encoding = String(encoding).toLowerCase(); + } if (!encoding || encoding == 'utf8' || encoding == 'utf-8') { // default to utf8