TextDecoder

open class TextDecoder(label: String = definedExternally, options: TextDecoderOptions = definedExternally) : TextDecoderCommon(source)

The TextDecoder interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, KOI8-R, GBK, etc.

MDN Reference

Constructors

Link copied to clipboard
constructor(label: String = definedExternally, options: TextDecoderOptions = definedExternally)

Properties

Link copied to clipboard
open val encoding: String

Returns encoding's name, lowercased.

Link copied to clipboard
open val fatal: Boolean

Returns true if error mode is "fatal", otherwise false.

Link copied to clipboard
open val ignoreBOM: Boolean

Returns the value of ignore BOM.

Functions

Link copied to clipboard
fun decode(input: AllowSharedBufferSource = definedExternally, options: TextDecodeOptions = definedExternally): String

The TextDecoder.decode() method returns a string containing text decoded from the buffer passed as a parameter.