doc: shorten character encoding introduction#19648
doc: shorten character encoding introduction#19648Trott wants to merge 2 commits intonodejs:masterfrom
Conversation
gireeshpunathil
left a comment
There was a problem hiding this comment.
sorry, but -1 for this change as such, it takes out information without providing alternatives IMO.
suggestions:
-
reword the removed text by addressing the problems you spotted, or stating the common use case for the character encodings.
-
the example provided does not fully cover the current wording (
converting between string and buffer) instead only buffer to string. An example ofBuffer.from(string[, encoding])will make it complete.
|
I feel I would agree with @gireeshpunathil. |
The first line of the example code is a |
|
sure, that looks great, @Trott ! |
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.
|
@gireeshpunathil @TimothyGu I've tried to address the comments. PTAL. Thanks. |
thanks @Trott, changes looks good to me now.
|
|
||
| console.log(Buffer.from('fhqwhgads', 'ascii')); | ||
| // Prints: <Buffer 66 68 71 77 68 67 61 64 73> | ||
| console.log(Buffer.from('fhqwhgads', 'ucs2')); |
There was a problem hiding this comment.
I'd very slightly prefer the name 'utf16le', which is I think better known (and more accurate) than 'ucs2'.
|
Lite CI rerun: https://ci.nodejs.org/job/node-test-pull-request-lite/358/ |
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.
PR-URL: nodejs#19648
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
|
Landed in 6c5144f |
Favor 'utf16le' over its alias 'ucs2' in `buffer.md`. Ref: nodejs#19648 (comment)
Favor 'utf16le' over its alias 'ucs2' in `buffer.md`. Ref: nodejs#19648 (comment) PR-URL: nodejs#19688 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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.
PR-URL: #19648
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Favor 'utf16le' over its alias 'ucs2' in `buffer.md`. Ref: #19648 (comment) PR-URL: #19688 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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.
Checklist