- Assertion testing
- Asynchronous context tracking
- Async hooks
- Buffer
- C++ addons
- C/C++ addons with Node-API
- C++ embedder API
- Child processes
- Cluster
- Command-line options
- Console
- Corepack
- Crypto
- Debugger
- Deprecated APIs
- Diagnostics Channel
- DNS
- Domain
- Errors
- Events
- File system
- Globals
- HTTP
- HTTP/2
- HTTPS
- Inspector
- Internationalization
- Modules: CommonJS modules
- Modules: ECMAScript modules
- Modules:
node:module
API - Modules: Packages
- Net
- OS
- Path
- Performance hooks
- Permissions
- Process
- Punycode
- Query strings
- Readline
- REPL
- Report
- Stream
- String decoder
- Test runner
- Timers
- TLS/SSL
- Trace events
- TTY
- UDP/datagram
- URL
- Utilities
- V8
- VM
- WASI
- Web Crypto API
- Web Streams API
- Worker threads
- Zlib
Node.js v18.12.1 documentation
- Node.js v18.12.1
- ► Table of contents
-
► Index
- Assertion testing
- Asynchronous context tracking
- Async hooks
- Buffer
- C++ addons
- C/C++ addons with Node-API
- C++ embedder API
- Child processes
- Cluster
- Command-line options
- Console
- Corepack
- Crypto
- Debugger
- Deprecated APIs
- Diagnostics Channel
- DNS
- Domain
- Errors
- Events
- File system
- Globals
- HTTP
- HTTP/2
- HTTPS
- Inspector
- Internationalization
- Modules: CommonJS modules
- Modules: ECMAScript modules
- Modules:
node:module
API - Modules: Packages
- Net
- OS
- Path
- Performance hooks
- Permissions
- Process
- Punycode
- Query strings
- Readline
- REPL
- Report
- Stream
- String decoder
- Test runner
- Timers
- TLS/SSL
- Trace events
- TTY
- UDP/datagram
- URL
- Utilities
- V8
- VM
- WASI
- Web Crypto API
- Web Streams API
- Worker threads
- Zlib
- ► Other versions
- ► Options
Table of contents
Internationalization support国际化支持#
Node.js has many features that make it easier to write internationalized programs. Some of them are:Node.js具有许多特性,可以更容易地编写国际化程序。其中包括:
Locale-sensitive or Unicode-aware functions in the ECMAScript Language Specification:ECMAScript语言规范中的区域设置敏感或Unicode感知函数:All functionality described in the ECMAScript Internationalization API Specification (aka ECMA-402):ECMAScript国际化API规范(又名ECMA-402)中描述的所有功能:Intl
object对象Locale-sensitive methods like区域设置敏感的方法,如String.prototype.localeCompare()
andDate.prototype.toLocaleString()
String.prototype.localeCompare()
和Date.prototype.toLocaleString()
The WHATWG URL parser's internationalized domain names (IDNs) supportWHATWG URL解析器的国际化域名(IDN)支持require('node:buffer').transcode()
More accurate REPL line editing更精确的REPL行编辑require('node:util').TextDecoder
RegExp
Unicode Property EscapesUnicode属性Escapes
Node.js and the underlying V8 engine use International Components for Unicode (ICU) to implement these features in native C/C++ code. Node.js和底层V8引擎使用Unicode国际组件(ICU)以本机C/C++代码实现这些功能。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.默认情况下,Node.js提供完整的ICU数据集。然而,由于ICU数据文件的大小,在构建或运行Node.js时,提供了几个选项来定制ICU数据集。