Skip to content

Commit

Permalink
doc: shorten character encoding introduction
Browse files Browse the repository at this point in the history
Keep the introduction for Buffers and character encodings short and to
the point. The current introduction doesn't provide much in the way of
useful additional information, but it is a bit confusing in its wording.
("such as" seems like it ought to refer to "encoded characters" but it
actually refers to character encodings, which are not mentioned in the
sentence. It may be arguable as to whether "hex-encoded" is in fact a
character encoding, whether it should be stylized as "Hex-encoded" or
not, and whether it should be spelled out as "Hexadecimal-encoded". None
of that information is particularly useful to the end user at this point
in the text. Omitting it simplifies and improves the documentation.)

Additionally, the section is now wrapped to 80 characters.
  • Loading branch information
Trott committed Mar 29, 2018
1 parent 42d1d72 commit 305633e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ changes:
description: Removed the deprecated `raw` and `raws` encodings.
-->

`Buffer` instances are commonly used to represent sequences of encoded characters
such as UTF-8, UCS2, Base64, or even Hex-encoded data. It is possible to
convert back and forth between `Buffer` instances and ordinary JavaScript strings
by using an explicit character encoding.
A character encoding may be specified when converting between a string and a
`Buffer`.

```js
const buf = Buffer.from('hello world', 'ascii');
Expand Down

0 comments on commit 305633e

Please sign in to comment.