From 91d694ee99b3ecef701df8bf19d041ef629bc92d Mon Sep 17 00:00:00 2001 From: Rahat Ahmed Date: Thu, 2 Mar 2017 09:22:12 -0600 Subject: [PATCH] doc: fix misleading ASCII comments PR-URL: https://github.com/nodejs/node/pull/11657 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Claudio Rodriguez --- doc/api/buffer.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 44e274760d30cd..4c7734e0968a33 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -38,11 +38,11 @@ const buf3 = Buffer.allocUnsafe(10); // Creates a Buffer containing [0x1, 0x2, 0x3]. const buf4 = Buffer.from([1, 2, 3]); -// Creates a Buffer containing ASCII bytes [0x74, 0x65, 0x73, 0x74]. -const buf5 = Buffer.from('test'); - // Creates a Buffer containing UTF-8 bytes [0x74, 0xc3, 0xa9, 0x73, 0x74]. -const buf6 = Buffer.from('tést', 'utf8'); +const buf5 = Buffer.from('tést'); + +// Creates a Buffer containing Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. +const buf6 = Buffer.from('tést', 'latin-1'); ``` ## `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` @@ -309,7 +309,7 @@ Allocates a new `Buffer` using an `array` of octets. Example: ```js -// Creates a new Buffer containing the ASCII bytes of the string 'buffer' +// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer' const buf = new Buffer([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); ``` @@ -716,7 +716,7 @@ Allocates a new `Buffer` using an `array` of octets. Example: ```js -// Creates a new Buffer containing ASCII bytes of the string 'buffer' +// Creates a new Buffer containing UTF-8 bytes of the string 'buffer' const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); ```