Default to UTF8 on stream write

This commit is contained in:
Ryan Dahl committed 2010-04-15 02:09:51 -07:00
1 parent 5281f29012
commit 2ad587cc35
1 file changed
+1 -1
+1 -1
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;