TextDecoder class

A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays.

MDN Reference

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

TextDecoder([String? label, TextDecoderOptions? options])
factory

Properties

decode String Function([Object?, TextDecodeOptions?])

Available on TextDecoder, provided by the TextDecoder$Typings extension

getter/setter pair
encoding String

Available on TextDecoderCommon, provided by the TextDecoderCommon$Typings extension

Returns encoding's name, lowercased.
no setter
fatal bool

Available on TextDecoderCommon, provided by the TextDecoderCommon$Typings extension

Returns true if error mode is "fatal", otherwise false.
no setter
hashCode int
The hash code for this object.
no setterinherited
ignoreBOM bool

Available on TextDecoderCommon, provided by the TextDecoderCommon$Typings extension

Returns the value of ignore BOM.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited