Closed
Description
Version: v11.10.1, v10.12.0
Platform: Windows 10 (64-bits)
Subsystem: buffer
File Encoding: UTF8
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,...)