| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/workers/runtime-apis/encoding/#textdecoder | [Back] [Original] |
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.
let encoder = new TextEncoder();
encoder.encoding DOMString read-only
TextEncoder uses (always utf-8).encode(inputUSVString) : Uint8Array
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.
let decoder = new TextDecoder();
decoder.encoding DOMString read-only
TextDecoder uses.decoder.fatal boolean read-only
decoder.ignoreBOM boolean read-only
decode() : DOMString
TextDecoder object. Learn more at MDNs TextDecoder documentation .| Web Proxy Viewer | New URL | Original Page |