System.Text.EncoderFallbackBuffer.Fallback Method

When overridden in a derived class, prepares the fallback buffer to handle the specified input character.

Syntax

public abstract bool Fallback (char charUnknown, int index)

Parameters

charUnknown
An input character.
index
The index position of the character in the input buffer.

Returns

true if the fallback buffer can process charUnknown; false if the fallback buffer ignores charUnknown.

Remarks

The erload:System.Text.Encoding.GetBytes and erload:System.Text.Encoder.Convert methods call DecoderFallbackBuffer.Fallback(Byte[], int) if they encounter an unknown input character that cannot be encoded. A return value of true indicates that the fallback buffer can process the input character, which causes the calling method to call the EncoderFallbackBuffer.GetNextChar method to obtain each character of the fallback buffer. Because it does not process individual characters, the EncoderFallbackBuffer.Fallback(char, int) method in an exception fallback handler throws an exception.

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0