Skip to content

Commit bc23dfe

Browse files
jgehrcketargos
authored andcommitted
doc: Buffer.toString(): add note about invalid data
PR-URL: #30706 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]>
1 parent d60da08 commit bc23dfe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/buffer.md

+2
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,8 @@ added: v0.1.90
21622162

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

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

0 commit comments

Comments
 (0)