tessel / t1-runtime

[UNMAINTAINED] Tessel 1 JavaScript runtime.
Other
117 stars 33 forks source link

`Buffer.prototype.write` ignores encoding argument #690

Closed natevw closed 9 years ago

natevw commented 9 years ago

To reproduce:

var b1 = Buffer("\ud83c\udf91", 'utf16le');
console.log(b1);

var b2 = Buffer(4);
b2.write("\ud83c\udf91", 'utf16le');
console.log(b2);

Expected:

<Buffer 3c d8 91 df> <Buffer 3c d8 91 df>

Actual:

<Buffer 3c d8 91 df> <Buffer f0 9f 8e 91>