-
Notifications
You must be signed in to change notification settings - Fork 30k
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
stream, doc: an ambiguity in the readable.read([size]) doc #7337
Comments
Related: #6798 |
By the way, is this another lacuna about readable stream? Should I post it as an issue here or do I just not understand the doc well? |
cc @nodejs/streams |
I think it's s duplicate of #6798. What is BOM? |
The byte-order mark, aka U+FEFF. It’s primarily used at the start of text for indicating the endianness of a UTF16/UTF32/etc-encoded text. Although it’s discouraged, it can also be used at the start of UTF-8 text (encoded as |
ping @nodejs/streams |
sounds like we need to update the docs to specify that it's in encoding dependent units |
Closing as a duplicate of #6798. |
The first paragraph makes distinction between buffer and string mode, but in the second paragraph only bytes are mentioned. It could seem that even in the string mode the
size
argument means bytes. However, in the string mode thesize
argument means decoded characters.Save this script in the UTF-8 with BOM and run it:
The output:
If in the string mode the
size
argument meant bytes, the output would be just the BOM.The text was updated successfully, but these errors were encountered: