From 305633e9b4bf0287dacaba4c030c0e2b64837ec1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 27 Mar 2018 21:34:43 -0700 Subject: [PATCH] doc: shorten character encoding introduction 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. --- doc/api/buffer.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index b551f72ad98029..0b8e7c6b976725 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -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');