buffer
buffer copied to clipboard
Incorrect toString for invalid UTF8 multibyte codepoints
For example Buffer.from(Buffer.from([0xE0, 0xAC]).toString()) produces <Buffer ef bf bd> with the native Node Buffer while this package currently outputs <Buffer ef bf bd ef bf bd>. So it somehow tries to match multiple bytes even if some of them are missing and doesn't emit a replacement character for every single byte.
This only adds failing tests because I'm not sure how this should be fixed