Skip to content

stream: handle setEncoding after buffered data#63973

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-readable-setencoding-buffered
Open

stream: handle setEncoding after buffered data#63973
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-readable-setencoding-buffered

Conversation

@mcollina

@mcollina mcollina commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fixes Readable.prototype.setEncoding() when it is called after byte data has already been buffered but before that data is consumed.

When the buffered data ends with an incomplete multibyte sequence and the stream has ended, the new decoder needs to be finalized so it can emit the replacement character instead of dropping the bytes.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Jun 18, 2026
@mcollina mcollina added request-ci Add this label to start a Jenkins CI on a PR. baking-for-lts PRs that need to wait before landing in a LTS release. labels Jun 18, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 18, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baking-for-lts PRs that need to wait before landing in a LTS release. needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants