I've noticed that partial bytes of UCS-2 symbols are written, while they shouldn't be according to the Node.js documentation.
Here's the code taken from Node.js test:
var f = new Buffer([0, 0, 0, 0, 0]);
assert.equal(f.length, 5);
var size = f.write('あいうえお', 'ucs2');
console.error('bytes written to buffer: %d (should be 4)', size);
assert.equal(size, 4);
assert.deepEqual(f, new Buffer([0x42, 0x30, 0x44, 0x30, 0x00]));
I've noticed that partial bytes of UCS-2 symbols are written, while they shouldn't be according to the Node.js documentation.
Here's the code taken from Node.js test: