This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: document fs.createReadStream() encodings
Fixes #2700.
- Loading branch information
0dd8e01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought encoding-wise you could use anything that buffer.toString() supports, since fs.ReadStream uses StringDecoder which uses buffer.toString() (for non-utf8 encoding).
0dd8e01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's true. hex and ucs2 are valid encodings too. I'll update the commit. I think we eventually need a kind of primer on string encodings that we can link to.
0dd8e01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point that I never really considered.
The Buffer docs have a good intro to the different string encodings, but a more thorough doc might be helpful.