Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TextDecoderStream
  4. encoding

TextDecoderStream: encoding property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2022⁩.

Note: This feature is available inWeb Workers.

Theencoding read-only property of theTextDecoderStream interface returns a string containing the name of the encoding algorithm used by the specific decoder.

The encoding is set by theconstructorlabel parameter, and defaults toutf-8.

Value

A string containing the lower-cased ASCII name of the encoding format.

The allowed values are the same as those listed inTextDecoder.encoding (the labels inEncoding API Encodings).

Examples

Returning the value ofencoding from aTextDecoderStream.

js
stream = new TextDecoderStream();console.log(stream.encoding); // returns the default "utf-8"

Specifications

Specification
Encoding
# dom-textdecoder-encoding

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp