Sha256: 49a54bdc86accfdd2be2b1acbc9716acbd429c843b4e2841c1c3c11deac364d3

Contents?: true

Size: 945 Bytes

Versions: 45

Compression:

Stored size: 945 Bytes

Contents

var assert = require('assert')
var saxStream = require('../lib/sax').createStream()

var b = new Buffer('误')

saxStream.on('text', function(text) {
  assert.equal(text, b.toString())
})

saxStream.write(new Buffer('<test><a>'))
saxStream.write(b.slice(0, 1))
saxStream.write(b.slice(1))
saxStream.write(new Buffer('</a><b>'))
saxStream.write(b.slice(0, 2))
saxStream.write(b.slice(2))
saxStream.write(new Buffer('</b><c>'))
saxStream.write(b)
saxStream.write(new Buffer('</c>'))
saxStream.write(Buffer.concat([new Buffer('<d>'), b.slice(0, 1)]))
saxStream.end(Buffer.concat([b.slice(1), new Buffer('</d></test>')]))

var saxStream2 = require('../lib/sax').createStream()

saxStream2.on('text', function(text) {
  assert.equal(text, '�')
});

saxStream2.write(new Buffer('<e>'));
saxStream2.write(new Buffer([0xC0]));
saxStream2.write(new Buffer('</e>'));
saxStream2.write(Buffer.concat([new Buffer('<f>'), b.slice(0,1)]));
saxStream2.end();

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
ela-4.1.6 node_modules/sax/test/utf8-split.js
ela-4.1.5 node_modules/sax/test/utf8-split.js
ela-4.1.4 node_modules/sax/test/utf8-split.js
ela-4.1.3 node_modules/sax/test/utf8-split.js
ela-4.1.2 node_modules/sax/test/utf8-split.js
ela-4.1.1 node_modules/sax/test/utf8-split.js
ela-4.1.0 node_modules/sax/test/utf8-split.js
ela-4.0.0 node_modules/sax/test/utf8-split.js
ela-3.4.3 node_modules/sax/test/utf8-split.js
ela-3.4.2 node_modules/sax/test/utf8-split.js
ela-3.4.0 node_modules/sax/test/utf8-split.js
ela-3.3.1 node_modules/sax/test/utf8-split.js
ela-3.3.0 node_modules/sax/test/utf8-split.js
ela-3.2.0 node_modules/sax/test/utf8-split.js
ela-3.1.1 node_modules/sax/test/utf8-split.js
ela-3.1.0 node_modules/sax/test/utf8-split.js
ela-3.0.0 node_modules/sax/test/utf8-split.js
ela-2.0.0 node_modules/sax/test/utf8-split.js
ela-1.1.0 node_modules/sax/test/utf8-split.js
stylus-source-0.54.5 vendor/node_modules/sax/test/utf8-split.js