Encoding.DecoderFallback Property

Definition

Gets or sets the DecoderFallback object for the current Encoding object.

public:
 property System::Text::DecoderFallback ^ DecoderFallback { System::Text::DecoderFallback ^ get(); };
public:
 property System::Text::DecoderFallback ^ DecoderFallback { System::Text::DecoderFallback ^ get(); void set(System::Text::DecoderFallback ^ value); };
public System.Text.DecoderFallback DecoderFallback { get; }
public System.Text.DecoderFallback DecoderFallback { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public System.Text.DecoderFallback DecoderFallback { get; set; }
member this.DecoderFallback : System.Text.DecoderFallback
member this.DecoderFallback : System.Text.DecoderFallback with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.DecoderFallback : System.Text.DecoderFallback with get, set
Public ReadOnly Property DecoderFallback As DecoderFallback
Public Property DecoderFallback As DecoderFallback

Property Value

The decoder fallback object for the current Encoding object.

Attributes

Exceptions

The value in a set operation is null.

A value cannot be assigned in a set operation because the current Encoding object is read-only.

Remarks

The DecoderFallback object represents an error handler that is invoked when an encoded byte sequence cannot be decoded into a character. Any one of the following handler types is supported:

  • A best-fit fallback handler, which replaces bytes that cannot be decoded with some suitable replacement character.

  • A replacement fallback handler, which replaces bytes that cannot be decoded with some arbitrary replacement character. .NET includes one replacement fallback handler, DecoderFallback, which by default replaces bytes that cannot be decoded with a question mark ("?") character.

  • An exception fallback handler, which throws an exception when bytes cannot be decoded. .NET includes one exception fallback handler, DecoderExceptionFallback, which throws a DecoderFallbackException when bytes cannot be decoded.

Applies to

See also