System.Text.EncoderReplacementFallbackBuffer.Fallback Method

Indicates whether a replacement string can be used when an input surrogate pair cannot be encoded, or whether the surrogate pair can be ignored. Parameters specify the surrogate pair and the index position of the pair in the input.

Syntax

public override bool Fallback (char charUnknownHigh, char charUnknownLow, int index)

Parameters

charUnknownHigh
The high surrogate of the input pair.
charUnknownLow
The low surrogate of the input pair.
index
The index position of the surrogate pair in the input buffer.

Returns

true if the replacement string is not empty; false if the replacement string is empty.

Remarks

The erload:System.Text.Encoding.GetBytes and erload:System.Text.Encoder.Convert methods call EncoderReplacementFallbackBuffer.Fallback(char, char, int) if they encounter an unknown character in their input. If the return value of EncoderReplacementFallbackBuffer.Fallback(char, char, int) is true, the calling method can invoke the EncoderReplacementFallbackBuffer.GetNextChar method to obtain each character in the replacement fallback buffer.

Requirements

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