Skip to content

utf16le encoding is missed in the File System API doc for streams #2787

Description

@vsemozhetbyt

There is an encoding list in the Buffer API doc: ascii, utf8, utf16le / ucs2, base64, binary, hex.

However the lists in the File System API doc for streams are not complete.

fs.createReadStream:

"The encoding can be 'utf8', 'ascii', or 'base64'."

fs.createWriteStream:

"The defaultEncoding can be 'utf8', 'ascii', binary, or 'base64'."

In the both lists the "utf16le / ucs2" encoding is misguidingly missed.

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    fsIssues and PRs related to file-system APIs and the fs module.
    on Sep 10, 2015
  2. claudiorodriguez commented on Sep 10, 2015

    @claudiorodriguez
    Contributor

    As far as I can see at https://github.com/nodejs/node/blob/278a9267ec41f37e6b7dda876c417945d7725973/lib/_stream_readable.js and https://github.com/nodejs/node/blob/278a9267ec41f37e6b7dda876c417945d7725973/lib/_stream_writable.js - both fs.createReadStream and fs.createWriteStream internally use Buffer, so they should accept all of Buffer's encodings, unless I'm missing something. Maybe we could mention this and put a link to Buffer's doc in both cases?

  3. vsemozhetbyt commented on Sep 10, 2015

    @vsemozhetbyt
    ContributorAuthor

    At least my tests prove that the utf16le encoding works with fs.createReadStream and fs.createWriteStream.

  4. added
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Oct 27, 2015
  5. jasnell commented on Apr 2, 2016

    @jasnell
    Member

    Fixed in master.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.i18n-apiIssues and PRs related to Node.js internationalization support.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions