Skip to content

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

Closed
@sam-github

Description

@sam-github

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions