Closed
Description
Version
23.4.0
Platform
macOS 15.1.1 (24B91)
Subsystem
No response
What steps will reproduce the bug?
~: node
Welcome to Node.js v23.4.0.
> b = new Uint8Array([97, 108, 101])
> decoder = new TextDecoder('ascii')
> decoder.decode(b)
<Buffer 61 6c 65>
How often does it reproduce? Is there a required condition?
Reproduces reliably.
What is the expected behavior? Why is that the expected behavior?
Returns a string instead of a buffer. See output from v23.3.0
:
~: node
Welcome to Node.js v23.3.0.
> b = new Uint8Array([97, 108, 101])
> decoder = new TextDecoder('ascii')
> decoder.decode(b)
'ale'
What do you see instead?
Returns a buffer.
Additional information
@mertcanaltin @RafaelGSS @anonrig @jasnell @lemire @targos #55275