From e585f95369a2522225dc43795f42927d0e28b28c Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 10 Aug 2018 22:04:47 -0700 Subject: [PATCH 1/2] doc: list encodings supported by buffer.transcode Fixes: https://github.com/nodejs/node/issues/15632 --- doc/api/buffer.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 8e1d1c325b6ca7..78ffb7dddccb39 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2508,6 +2508,9 @@ encoding to another. Returns a new `Buffer` instance. Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if conversion from `fromEnc` to `toEnc` is not permitted. +Encodings supported by `buffer.transcode()` include: `'ascii'`, `'utf8'`, +`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + The transcoding process will use substitution characters if a given byte sequence cannot be adequately represented in the target encoding. For instance: From 9577a29241ad2ef5e70d1e7a99362b8507e1f942 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 10 Aug 2018 23:17:25 -0700 Subject: [PATCH 2/2] squash! word change --- doc/api/buffer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 78ffb7dddccb39..d483fe4033aced 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2508,7 +2508,7 @@ encoding to another. Returns a new `Buffer` instance. Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if conversion from `fromEnc` to `toEnc` is not permitted. -Encodings supported by `buffer.transcode()` include: `'ascii'`, `'utf8'`, +Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. The transcoding process will use substitution characters if a given byte