Skip to content

Commit d06dbf0

Browse files
rahatarmanahmedaddaleax
authored andcommitted
doc: fix misleading ASCII comments
PR-URL: #11657 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]>
1 parent 5df9110 commit d06dbf0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/buffer.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ const buf3 = Buffer.allocUnsafe(10);
3838
// Creates a Buffer containing [0x1, 0x2, 0x3].
3939
const buf4 = Buffer.from([1, 2, 3]);
4040

41-
// Creates a Buffer containing ASCII bytes [0x74, 0x65, 0x73, 0x74].
42-
const buf5 = Buffer.from('test');
43-
4441
// Creates a Buffer containing UTF-8 bytes [0x74, 0xc3, 0xa9, 0x73, 0x74].
45-
const buf6 = Buffer.from('tést', 'utf8');
42+
const buf5 = Buffer.from('tést');
43+
44+
// Creates a Buffer containing Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
45+
const buf6 = Buffer.from('tést', 'latin-1');
4646
```
4747

4848
## `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`
@@ -331,7 +331,7 @@ Allocates a new `Buffer` using an `array` of octets.
331331
Example:
332332

333333
```js
334-
// Creates a new Buffer containing the ASCII bytes of the string 'buffer'
334+
// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'
335335
const buf = new Buffer([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
336336
```
337337

@@ -779,7 +779,7 @@ Allocates a new `Buffer` using an `array` of octets.
779779
Example:
780780

781781
```js
782-
// Creates a new Buffer containing ASCII bytes of the string 'buffer'
782+
// Creates a new Buffer containing UTF-8 bytes of the string 'buffer'
783783
const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
784784
```
785785

0 commit comments

Comments
 (0)