Default to UTF8 on stream write

This commit is contained in:
Ryan Dahl 2010-04-15 02:09:36 -07:00
parent 5281f29012
commit 2ad587cc35

View File

@ -429,7 +429,7 @@ Stream.prototype._writeOut = function (data, encoding) {
allocNewPool();
}
if (encoding == 'utf8' || encoding == 'utf-8') {
if (!encoding || encoding == 'utf8' || encoding == 'utf-8') {
// default to utf8
bytesWritten = pool.write(data, 'utf8', pool.used);
charsWritten = Buffer._charsWritten;