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

socket encodings don't link to possible encoding values, and describe behaviour which does not exist #11352

Closed
sam-github opened this issue Feb 13, 2017 · 4 comments
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. net Issues and PRs related to the net subsystem.

Comments

@sam-github
Copy link
Contributor

sam-github commented Feb 13, 2017

The documentation at:

https://nodejs.org/api/stream.html#stream_readable_setencoding_encoding

...does not describe what all of the supported encodings are (there are more than just 'UTF8' and 'hex'), nor does it link to any further documentation on them. Also, this documentation refers to "setEncoding(null)" as the recommended approach for binary streams, which is incorrect and does not work (this defaults to UTF8 encoding). There also appears to be an undocumented or semi-documented 'binary' encoding.

On the other hand, the documentation for use of encodings on Buffer objects is comprehensive and informative:

https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings

Reported in comment #11316 (comment) by @RickBullotta, I have not verified setEncoding(null) not working.

  • Version: all
  • Platform: not relevant
  • Subsystem: doc, net
@sam-github sam-github added doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem. labels Feb 13, 2017
@sam-github sam-github added the good first issue Issues that are suitable for first-time contributors. label Feb 13, 2017
@sam-github
Copy link
Contributor Author

@RickBullotta If you'd like to get involved in making this better, this is a good first contribution.

@QuentinGibson
Copy link

@sam-github Could I give it a shot? I never contributed before but this seems like a good starting point.

@RickBullotta
Copy link
Contributor

RickBullotta commented Feb 14, 2017 via email

@QuentinGibson
Copy link

QuentinGibson commented Feb 14, 2017

Edit: @RickBullotta For clarification, are encoders 'utf-8', 'hex', etc.
Also would I link 'utf-8' to the Buffer and Character encoding section

anchnk pushed a commit to anchnk/node that referenced this issue May 19, 2017
Removed an incorrect reference to the use of setEncoding(null) as the
proper way to handling binary streams or to disable encoding, and
explained that the default encoding is "no encoding", and that this is
the correct approach for dealing with binary data via Buffers.

PR-URL: nodejs#11363
Fixes: nodejs#11352
Refs: nodejs#11316
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
MylesBorins pushed a commit that referenced this issue Jul 17, 2017
Removed an incorrect reference to the use of setEncoding(null) as the
proper way to handling binary streams or to disable encoding, and
explained that the default encoding is "no encoding", and that this is
the correct approach for dealing with binary data via Buffers.

PR-URL: #11363
Fixes: #11352
Refs: #11316
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants