构建 Node.js 的选项
【Options for building Node.js】
要控制 Node.js 中 ICU 的使用,在编译过程中可以使用四个 configure 选项。有关如何编译 Node.js 的更多详细信息,请参见 BUILDING.md。
【To control how ICU is used in Node.js, four configure options are available
during compilation. Additional details on how to compile Node.js are documented
in BUILDING.md.】
--with-intl=none/--without-intl--with-intl=system-icu--with-intl=small-icu--with-intl=full-icu(默认)
每个 configure 选项可用的 Node.js 和 JavaScript 功能概览:
【An overview of available Node.js and JavaScript features for each configure
option:】
| Feature | none | system-icu | small-icu | full-icu |
|---|---|---|---|---|
String.prototype.normalize() | none (function is no-op) | full | full | full |
String.prototype.to*Case() | full | full | full | full |
Intl | none (object does not exist) | partial/full (depends on OS) | partial (English-only) | full |
String.prototype.localeCompare() | partial (not locale-aware) | full | full | full |
String.prototype.toLocale*Case() | partial (not locale-aware) | full | full | full |
Number.prototype.toLocaleString() | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full |
Date.prototype.toLocale*String() | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full |
| Legacy URL Parser | partial (no IDN support) | full | full | full |
| WHATWG URL Parser | partial (no IDN support) | full | full | full |
require('node:buffer').transcode() | none (function does not exist) | full | full | full |
| REPL | partial (inaccurate line editing) | full | full | full |
require('node:util').TextDecoder | partial (basic encodings support) | partial/full (depends on OS) | partial (Unicode-only) | full |
RegExp Unicode Property Escapes | none (invalid RegExp error) | full | full | full |
“(非地区感知)”的标记表示该函数的操作方式与非 Locale 版本的函数相同(如果存在的话)。例如,在 none 模式下,Date.prototype.toLocaleString() 的操作与 Date.prototype.toString() 的操作完全相同。
【The "(not locale-aware)" designation denotes that the function carries out its
operation just like the non-Locale version of the function, if one
exists. For example, under none mode, Date.prototype.toLocaleString()'s
operation is identical to that of Date.prototype.toString().】