Browse Source

Hack to support UTF8 writes again!

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
e232cf3100
  1. 5
      lib/net.js

5
lib/net.js

@ -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;

Loading…
Cancel
Save