Skip to content

Commit

Permalink
doc: Buffer.toString(): add note about invalid data
Browse files Browse the repository at this point in the history
PR-URL: #30706
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
  • Loading branch information
jgehrcke authored and targos committed Jan 13, 2020
1 parent d60da08 commit bc23dfe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2162,6 +2162,8 @@ added: v0.1.90

Decodes `buf` to a string according to the specified character encoding in
`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
If a byte sequence in the input is not valid in the given `encoding` then
it is replaced with the replacement character `U+FFFD`.

The maximum length of a string instance (in UTF-16 code units) is available
as [`buffer.constants.MAX_STRING_LENGTH`][].
Expand Down

0 comments on commit bc23dfe

Please sign in to comment.