W3cubDocs

/Web APIs

TextDecoder: fatal property

The fatal read-only property of the TextDecoder interface is a Boolean indicating whether the error mode is 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 TextDecoder() constructor.

Value

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

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 38 79 36 No 25 10.1 38 38 36 25 10.3 3.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/TextDecoder/fatal