构建 Node.js 的选项
¥Options for building Node.js
为了控制在 Node.js 中如何使用 ICU,在编译期间提供了四个 configure
选项。BUILDING.md 中记录了有关如何编译 Node.js 的其他详细信息。
¥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
(默认)¥
--with-intl=full-icu
(default)
每个 configure
选项的可用 Node.js 和 JavaScript 特性概述:
¥An overview of available Node.js and JavaScript features for each configure
option:
特性 | none | system-icu | small-icu | full-icu |
---|---|---|---|---|
String.prototype.normalize() | 无(函数无操作) | 完全 | 完全 | 完全 |
String.prototype.to*Case() | 完全 | 完全 | 完全 | 完全 |
Intl | 无(对象不存在) | 部分/完整(取决于操作系统) | 部分(仅限英语) | 完全 |
String.prototype.localeCompare() | 部分(不识别区域设置) | 完全 | 完全 | 完全 |
String.prototype.toLocale*Case() | 部分(不识别区域设置) | 完全 | 完全 | 完全 |
Number.prototype.toLocaleString() | 部分(不识别区域设置) | 部分/完整(取决于操作系统) | 部分(仅限英语) | 完全 |
Date.prototype.toLocale*String() | 部分(不识别区域设置) | 部分/完整(取决于操作系统) | 部分(仅限英语) | 完全 |
旧版 URL 解析器 | 部分(不支持 IDN) | 完全 | 完全 | 完全 |
WHATWG URL 解析器 | 部分(不支持 IDN) | 完全 | 完全 | 完全 |
require('node:buffer').transcode() | 无(函数不存在) | 完全 | 完全 | 完全 |
REPL | 部分(行编辑不准确) | 完全 | 完全 | 完全 |
require('node:util').TextDecoder | 部分(基本编码支持) | 部分/完整(取决于操作系统) | 部分(仅限 Unicode) | 完全 |
RegExp Unicode 属性转义 | 无(无效 RegExp 错误) | 完全 | 完全 | 完全 |
"(不识别区域设置)" 标志表示该函数执行其操作就像该函数的非 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()
.