TextDecoder
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1464
The TextDecoder interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, KOI8-R, GBK, etc.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TextDecoder(
label?,options?):TextDecoder
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1465
Parameters
Section titled “Parameters”label?
Section titled “label?”string
options?
Section titled “options?”Returns
Section titled “Returns”TextDecoder
Properties
Section titled “Properties”encoding
Section titled “encoding”
readonlyencoding:string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1475
readonlyfatal:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1476
ignoreBOM
Section titled “ignoreBOM”
readonlyignoreBOM:boolean
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1477
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(
input?,options?):string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1471
The TextDecoder.decode() method returns a string containing text decoded from the buffer passed as a parameter.
Parameters
Section titled “Parameters”input?
Section titled “input?”ArrayBuffer | ArrayBufferView<ArrayBufferLike>
options?
Section titled “options?”Returns
Section titled “Returns”string