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

Don't call stream.setEncoding() if options.encoding is strictly null #29

Merged
merged 1 commit into from
Apr 29, 2016
Merged

Don't call stream.setEncoding() if options.encoding is strictly null #29

merged 1 commit into from
Apr 29, 2016

Conversation

apazzolini
Copy link
Contributor

@apazzolini apazzolini commented Apr 28, 2016

When stream.setEncoding is called, it additionally sets the decoder in the underlying stream. Unfortunately, despite what the official documentation says, calling setEncoding(null) sets the underlying decoder to UTF-8.

This causes problems when you need the raw buffer data of a file to pipe elsewhere, such as a zlib.gunzip stream for gunzipping files.

This pull request allows specifying { encoding: null } to disable that call.

@fshost fshost merged commit 6879326 into fshost:master Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants