Permalink
Browse files

Make the encoding option case insensitive when writing to a socket

  • Loading branch information...
1 parent 64b4168 commit 482d0ed1af4d93d3a8ce200887880c41f74b4c6b @ajclarkedubit committed Aug 26, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/net_legacy.js
View
@@ -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

0 comments on commit 482d0ed

Please sign in to comment.