W3cubDocs

/Web APIs

TextDecoderStream: fatal property

The fatal read-only property of the TextDecoderStream interface is a boolean indicating if the error mode of the TextDecoderStream object is set to fatal.

If the property is true then a decoder will throw a TypeError if it encounters malformed data while decoding. If false the decoder will substitute the invalid data with the replacement character U+FFFD (�). The value of the property is set in the TextDecoderStream() constructor.

Value

A boolean which will return true if the error mode is set to "fatal". Otherwise it returns false, indicating that the error mode is "replacement".

Examples

js

stream = new TextDecoderStream();
console.log(stream.fatal); // returns false

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
fatal 71 79 105 No 58 14.1 71 71 105 50 14.5 10.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TextDecoderStream/fatal