TextDecoder Class
https://encoding.spec.whatwg.org/#interface-textdecoder
public sealed class TextDecoderConstructors
| Name | Description |
|---|---|
| TextDecoder(string, TextDecoderOptions?) | Creates a decoder for the encoding identified by the given label. |
TextDecoder(string, TextDecoderOptions?)
TextDecoder.csCreates a decoder for the encoding identified by the given label.
public TextDecoder(string label = "utf-8", TextDecoderOptions? options = null)Properties
| Name | Description |
|---|---|
| Encoding | Gets the encoding's name, ASCII lowercased. |
| Fatal | Gets a value indicating whether decoding throws on invalid data instead of using replacement characters. |
| IgnoreBom | Gets a value indicating whether the byte order mark is kept in the decoded output. |
Encoding
TextDecoder.csGets the encoding's name, ASCII lowercased.
public string Encoding { get; }Fatal
TextDecoder.csGets a value indicating whether decoding throws on invalid data instead of using replacement characters.
public bool Fatal { get; }IgnoreBom
TextDecoder.csGets a value indicating whether the byte order mark is kept in the decoded output.
public bool IgnoreBom { get; }Methods
| Name | Description |
|---|---|
| Decode(ReadOnlySpan<byte>, TextDecodeOptions?) | Decodes the bytes (https://encoding.spec.whatwg.org/#dom-textdecoder-decode): a missing input is an empty input. |
Decode(ReadOnlySpan<byte>, TextDecodeOptions?)
TextDecoder.csDecodes the bytes (https://encoding.spec.whatwg.org/#dom-textdecoder-decode): a missing input is an empty input.
public string Decode(ReadOnlySpan<byte> input = default, TextDecodeOptions? options = null)