Skip to content

Commit b6bd3cf

Browse files
vsemozhetbytaddaleax
authored andcommitted
doc: cross-link util.TextDecoder and intl.md
Also, note about builds without ICU and ASCII-sort some bottom references. PR-URL: #14486 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9a3fc10 commit b6bd3cf

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

doc/api/intl.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ programs. Some of them are:
1616
- The [WHATWG URL parser][]'s [internationalized domain names][] (IDNs) support
1717
- [`require('buffer').transcode()`][]
1818
- More accurate [REPL][] line editing
19+
- [`require('util').TextDecoder`][]
1920

2021
Node.js (and its underlying V8 engine) uses [ICU][] to implement these features
2122
in native C/C++ code. However, some of them require a very large ICU data file
@@ -51,6 +52,7 @@ option:
5152
| [WHATWG URL Parser][] | partial (no IDN support) | full | full | full
5253
| [`require('buffer').transcode()`][] | none (function does not exist) | full | full | full
5354
| [REPL][] | partial (inaccurate line editing) | full | full | full
55+
| [`require('util').TextDecoder`][] | none (class does not exist) | partial/full (depends on OS) | partial (Unicode-only) | full
5456

5557
*Note*: The "(not locale-aware)" designation denotes that the function carries
5658
out its operation just like the non-`Locale` version of the function, if one
@@ -184,26 +186,27 @@ to be helpful:
184186
- [Test262][]: ECMAScript's official conformance test suite includes a section
185187
dedicated to ECMA-402.
186188

187-
[btest402]: https://github.com/srl295/btest402
188-
[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md
189-
[BUILDING.md#full-icu]: https://github.com/nodejs/node/blob/master/BUILDING.md#build-with-full-icu-support-all-locales-supported-by-icu
190-
[`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
191-
[ECMA-262]: https://tc39.github.io/ecma262/
192-
[ECMA-402]: https://tc39.github.io/ecma402/
193-
[full-icu]: https://www.npmjs.com/package/full-icu
194-
[ICU]: http://icu-project.org/
195189
["ICU Data"]: http://userguide.icu-project.org/icudata
196190
[`--icu-data-dir`]: cli.html#cli_icu_data_dir_file
197-
[internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized_domain_name
191+
[`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
198192
[`Intl`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl
199193
[`Intl.DateTimeFormat`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
200194
[`NODE_ICU_DATA`]: cli.html#cli_node_icu_data_file
201195
[`Number.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString
202-
[REPL]: repl.html#repl_repl
203196
[`require('buffer').transcode()`]: buffer.html#buffer_buffer_transcode_source_fromenc_toenc
197+
[`require('util').TextDecoder`]: util.html#util_class_util_textdecoder
204198
[`String.prototype.localeCompare()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
205199
[`String.prototype.normalize()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
206200
[`String.prototype.toLowerCase()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
207201
[`String.prototype.toUpperCase()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
202+
[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md
203+
[BUILDING.md#full-icu]: https://github.com/nodejs/node/blob/master/BUILDING.md#build-with-full-icu-support-all-locales-supported-by-icu
204+
[ECMA-262]: https://tc39.github.io/ecma262/
205+
[ECMA-402]: https://tc39.github.io/ecma402/
206+
[ICU]: http://icu-project.org/
207+
[REPL]: repl.html#repl_repl
208208
[Test262]: https://github.com/tc39/test262/tree/master/test/intl402
209209
[WHATWG URL parser]: url.html#url_the_whatwg_url_api
210+
[btest402]: https://github.com/srl295/btest402
211+
[full-icu]: https://www.npmjs.com/package/full-icu
212+
[internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized_domain_name

doc/api/util.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,8 @@ string += decoder.decode(); // end-of-stream
560560
Per the [WHATWG Encoding Standard][], the encodings supported by the
561561
`TextDecoder` API are outlined in the tables below. For each encoding,
562562
one or more aliases may be used. Support for some encodings is enabled
563-
only when Node.js is using the full ICU data.
563+
only when Node.js is using the full ICU data (see [Internationalization][]).
564+
`util.TextDecoder` is `undefined` when ICU is not enabled during build.
564565

565566
##### Encodings Supported By Default
566567

@@ -1158,18 +1159,19 @@ deprecated: v0.11.3
11581159
11591160
Deprecated predecessor of `console.log`.
11601161

1162+
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
11611163
[`Array.isArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
11621164
[`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj
11631165
[`Error`]: errors.html#errors_class_error
11641166
[`Object.assign()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
11651167
[`console.error()`]: console.html#console_console_error_data_args
11661168
[`console.log()`]: console.html#console_console_log_data_args
1167-
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
11681169
[`util.inspect()`]: #util_util_inspect_object_options
11691170
[`util.promisify()`]: #util_util_promisify_original
11701171
[Custom inspection functions on Objects]: #util_custom_inspection_functions_on_objects
1171-
[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors
11721172
[Custom promisified functions]: #util_custom_promisified_functions
1173+
[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors
1174+
[Internationalization]: intl.html
1175+
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
11731176
[constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor
11741177
[semantically incompatible]: https://github.com/nodejs/node/issues/4179
1175-
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/

0 commit comments

Comments
 (0)