Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: convert existing buffer when calling .setEncoding #27936

Closed

Conversation

addaleax
Copy link
Member

Convert already-stored chunks when .setEncoding() is called
so that subsequent data events will receive decoded strings,
as they expect.

Fixes: #27932

@nodejs/streams

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Convert already-stored chunks when `.setEncoding()` is called
so that subsequent `data` events will receive decoded strings,
as they expect.

Fixes: nodejs#27932
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@addaleax addaleax added the stream Issues and PRs related to the stream subsystem. label May 28, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 29, 2019
@Trott
Copy link
Member

Trott commented May 30, 2019

Landed in afb8474

@Trott Trott closed this May 30, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request May 30, 2019
Convert already-stored chunks when `.setEncoding()` is called
so that subsequent `data` events will receive decoded strings,
as they expect.

Fixes: nodejs#27932

PR-URL: nodejs#27936
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request May 31, 2019
Convert already-stored chunks when `.setEncoding()` is called
so that subsequent `data` events will receive decoded strings,
as they expect.

Fixes: #27932

PR-URL: #27936
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targos targos mentioned this pull request Jun 3, 2019
BethGriggs pushed a commit that referenced this pull request Jul 9, 2019
Convert already-stored chunks when `.setEncoding()` is called
so that subsequent `data` events will receive decoded strings,
as they expect.

Fixes: #27932

PR-URL: #27936
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 17, 2019
Convert already-stored chunks when `.setEncoding()` is called
so that subsequent `data` events will receive decoded strings,
as they expect.

Fixes: #27932

PR-URL: #27936
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delayed setEncoding on Readable causes multibyte characters to break
7 participants