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

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

Closed
vsemozhetbyt opened this issue Sep 10, 2015 · 3 comments
Closed
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. i18n-api Issues and PRs related to the i18n implementation.

Comments

@vsemozhetbyt
Copy link
Contributor

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.

@mscdex mscdex added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Sep 10, 2015
@claudiorodriguez
Copy link
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?

@vsemozhetbyt
Copy link
Contributor Author

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

@srl295 srl295 added the i18n-api Issues and PRs related to the i18n implementation. label Oct 27, 2015
@jasnell
Copy link
Member

jasnell commented Apr 2, 2016

Fixed in master.

@jasnell jasnell closed this as completed Apr 2, 2016
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. fs Issues and PRs related to the fs subsystem / file system. i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

5 participants