Skip to content

docs: Buffer.toString(): add note about invalid data#30706

Closed
jgehrcke wants to merge 2 commits intonodejs:masterfrom
jgehrcke:patch-1
Closed

docs: Buffer.toString(): add note about invalid data#30706
jgehrcke wants to merge 2 commits intonodejs:masterfrom
jgehrcke:patch-1

Conversation

@jgehrcke
Copy link
Contributor

@jgehrcke jgehrcke commented Nov 28, 2019

New to the ecosystem. I looked up the docs to see how Buffer.toString() behaves upon invalid input data (for building solid code it's of course critically important to know whether it throws an error, or if it performs a surrogate escape instead). Is not documented as of today.

Once we modify the documentation we can close #23280.

There is an existing patch: #28249 -- but it's probably too controversial as of the amount of information I think.

I tried to stay minimal here, so that we at least don't ignore the topic in the docs.

#6075 is about the same topic, I think nobody questions that we need to have the behavior of toString() documented w.r.t. invalid byte sequences in the input.

Checklist

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer.toString('utf8') appears to use wtf-8

7 participants