|
|
@ -452,7 +452,10 @@ Stream.prototype._writeOut = function (data, encoding) { |
|
|
|
|
|
|
|
if (encoding == 'utf8' || encoding == 'utf-8') { |
|
|
|
bytesWritten = pool.utf8Write(data, pool.used); |
|
|
|
charsWritten = bytesWritten; // XXX FIXME
|
|
|
|
// XXX Hacky way to find out the number of characters written.
|
|
|
|
// Waiting for a more optimal way: http://codereview.chromium.org/1539013
|
|
|
|
var _s = pool.utf8Slice(pool.used, pool.used + bytesWritten); |
|
|
|
charsWritten = _s.length; |
|
|
|
} else if (encoding == 'ascii') { |
|
|
|
bytesWritten = pool.asciiWrite(data, pool.used); |
|
|
|
charsWritten = bytesWritten; |
|
|
|