You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please consider the following 3 lines of code:
let buf = Buffer.alloc(9);
buf.write('\ud842\udfb7', 1, 'utf16le');
console.log(buf); //<Buffer 00 42 d8 b7 df df 00 00 00>
In this example, only 4 bytes should be written.
However, the last 'df' (the 5th byte) is incorrectly written when the offset is odd number (1,3,5,...)