Encoding


目录

Background

The TextEncoder takes a stream of code points as input and emits a stream of bytes. Encoding types passed to the constructor are ignored and a UTF-8 TextEncoder is created.

TextEncoder() returns a newly constructed TextEncoder that generates a byte stream with UTF-8 encoding. TextEncoder takes no parameters and throws no exceptions.

Constructor

let encoder = new TextEncoder();

Properties

Methods


TextDecoder

Background

The TextDecoder interface represents a UTF-8 decoder. Decoders take a stream of bytes as input and emit a stream of code points.

TextDecoder() returns a newly constructed TextDecoder that generates a code-point stream.

Constructor

let decoder = new TextDecoder();

Properties

Methods


版本号 #2
由 壳壳虫 创建于 2026-11-01 05:49:45 UTC
由 壳壳虫 更新于 2026-11-01 05:49:47 UTC