Skip to content

Commit

Permalink
Make the encoding option case insensitive when writing to a socket
Browse files Browse the repository at this point in the history
  • Loading branch information
ajclarkedubit committed Aug 26, 2011
1 parent 64b4168 commit 482d0ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/net_legacy.js
Expand Up @@ -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
Expand Down

0 comments on commit 482d0ed

Please sign in to comment.