From 51946c09852fc14bfc055e89cedf3b008cf41904 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 26 Jul 2017 00:02:37 +0300 Subject: [PATCH] doc: cross-link util.TextDecoder and intl.md Also, note about builds without ICU and ASCII-sort some bottom references. --- doc/api/intl.md | 23 +++++++++++++---------- doc/api/util.md | 10 ++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/doc/api/intl.md b/doc/api/intl.md index c0d6b82289264f..753932c91c25f7 100644 --- a/doc/api/intl.md +++ b/doc/api/intl.md @@ -16,6 +16,7 @@ programs. Some of them are: - The [WHATWG URL parser][]'s [internationalized domain names][] (IDNs) support - [`require('buffer').transcode()`][] - More accurate [REPL][] line editing +- [`require('util').TextDecoder`][] Node.js (and its underlying V8 engine) uses [ICU][] to implement these features in native C/C++ code. However, some of them require a very large ICU data file @@ -51,6 +52,7 @@ option: | [WHATWG URL Parser][] | partial (no IDN support) | full | full | full | [`require('buffer').transcode()`][] | none (function does not exist) | full | full | full | [REPL][] | partial (inaccurate line editing) | full | full | full +| [`require('util').TextDecoder`][] | none (class does not exist) | partial/full (depends on OS) | partial (Unicode-only) | full *Note*: The "(not locale-aware)" designation denotes that the function carries out its operation just like the non-`Locale` version of the function, if one @@ -184,26 +186,27 @@ to be helpful: - [Test262][]: ECMAScript's official conformance test suite includes a section dedicated to ECMA-402. -[btest402]: https://github.com/srl295/btest402 -[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md -[BUILDING.md#full-icu]: https://github.com/nodejs/node/blob/master/BUILDING.md#build-with-full-icu-support-all-locales-supported-by-icu -[`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString -[ECMA-262]: https://tc39.github.io/ecma262/ -[ECMA-402]: https://tc39.github.io/ecma402/ -[full-icu]: https://www.npmjs.com/package/full-icu -[ICU]: http://icu-project.org/ ["ICU Data"]: http://userguide.icu-project.org/icudata [`--icu-data-dir`]: cli.html#cli_icu_data_dir_file -[internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized_domain_name +[`Date.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString [`Intl`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl [`Intl.DateTimeFormat`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat [`NODE_ICU_DATA`]: cli.html#cli_node_icu_data_file [`Number.prototype.toLocaleString()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString -[REPL]: repl.html#repl_repl [`require('buffer').transcode()`]: buffer.html#buffer_buffer_transcode_source_fromenc_toenc +[`require('util').TextDecoder`]: util.html#util_class_util_textdecoder [`String.prototype.localeCompare()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare [`String.prototype.normalize()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/normalize [`String.prototype.toLowerCase()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase [`String.prototype.toUpperCase()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase +[BUILDING.md]: https://github.com/nodejs/node/blob/master/BUILDING.md +[BUILDING.md#full-icu]: https://github.com/nodejs/node/blob/master/BUILDING.md#build-with-full-icu-support-all-locales-supported-by-icu +[ECMA-262]: https://tc39.github.io/ecma262/ +[ECMA-402]: https://tc39.github.io/ecma402/ +[ICU]: http://icu-project.org/ +[REPL]: repl.html#repl_repl [Test262]: https://github.com/tc39/test262/tree/master/test/intl402 [WHATWG URL parser]: url.html#url_the_whatwg_url_api +[btest402]: https://github.com/srl295/btest402 +[full-icu]: https://www.npmjs.com/package/full-icu +[internationalized domain names]: https://en.wikipedia.org/wiki/Internationalized_domain_name diff --git a/doc/api/util.md b/doc/api/util.md index ab26ed9c28a514..27bf540915cecb 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -560,7 +560,8 @@ string += decoder.decode(); // end-of-stream Per the [WHATWG Encoding Standard][], the encodings supported by the `TextDecoder` API are outlined in the tables below. For each encoding, one or more aliases may be used. Support for some encodings is enabled -only when Node.js is using the full ICU data. +only when Node.js is using the full ICU data (see [Internationalization][]). +`util.TextDecoder` is `undefined` when ICU is not enabled during build. ##### Encodings Supported By Default @@ -1158,18 +1159,19 @@ deprecated: v0.11.3 Deprecated predecessor of `console.log`. +[`'uncaughtException'`]: process.html#process_event_uncaughtexception [`Array.isArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray [`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj [`Error`]: errors.html#errors_class_error [`Object.assign()`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign [`console.error()`]: console.html#console_console_error_data_args [`console.log()`]: console.html#console_console_log_data_args -[`'uncaughtException'`]: process.html#process_event_uncaughtexception [`util.inspect()`]: #util_util_inspect_object_options [`util.promisify()`]: #util_util_promisify_original [Custom inspection functions on Objects]: #util_custom_inspection_functions_on_objects -[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors [Custom promisified functions]: #util_custom_promisified_functions +[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors +[Internationalization]: intl.html +[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/ [constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor [semantically incompatible]: https://github.com/nodejs/node/issues/4179 -[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/