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 BethGriggs committed Feb 6, 2020
1 parent a152458 commit ab73047
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
@@ -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`][].

0 comments on commit ab73047

Please sign in to comment.