国际化支持
¥Internationalization support
Node.js 有很多特性可以让编写国际化程序变得更容易。它们之中有一些是:
¥Node.js has many features that make it easier to write internationalized programs. Some of them are:
-
ECMAScript 语言规范 中的语言环境敏感或 Unicode 感知函数:
¥Locale-sensitive or Unicode-aware functions in the ECMAScript Language Specification:
-
ECMAScript 国际化 API 规范(又名 ECMA-402)中描述的所有功能:
¥All functionality described in the ECMAScript Internationalization API Specification (aka ECMA-402):
-
Intl
对象¥
Intl
object -
像
String.prototype.localeCompare()
和Date.prototype.toLocaleString()
这样的区域敏感方法¥Locale-sensitive methods like
String.prototype.localeCompare()
andDate.prototype.toLocaleString()
-
-
WHATWG URL 解析器 的 国际化域名 (IDNs) 支持
¥The WHATWG URL parser's internationalized domain names (IDNs) support
-
更准确的 REPL 行编辑
¥More accurate REPL line editing
Node.js 和底层 V8 引擎使用 Unicode 国际组件 (ICU) 在原生 C/C++ 代码中实现这些功能。默认情况下,Node.js 提供了完整的 ICU 数据集。但是,由于 ICU 数据文件的大小,在构建或运行 Node.js 时提供了几个用于自定义 ICU 数据集的选项。
¥Node.js and the underlying V8 engine use International Components for Unicode (ICU) to implement these features in native C/C++ code. The full ICU data set is provided by Node.js by default. However, due to the size of the ICU data file, several options are provided for customizing the ICU data set either when building or running Node.js.