Encoding · Cloudflare Workers docs | Latest TMZ Celebrity News & Gossip | Watch TMZ Live Skip to content
Cloudflare Docs

Encoding

TextEncoder

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

  • encoder.encoding DOMString read-only
    • The name of the encoder as a string describing the method the TextEncoder uses (always utf-8).

Methods

  • encode(inputUSVString) : Uint8Array

    • Encodes a string input.

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

  • decoder.encoding DOMString read-only

    • The name of the decoder that describes the method the TextDecoder uses.
  • decoder.fatal boolean read-only

    • Indicates if the error mode is fatal.
  • decoder.ignoreBOM boolean read-only

    • Indicates if the byte-order marker is ignored.

Methods

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.