EncoderReplacementFallbackBuffer.Fallback Method (Char, Char, Int32)


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.

Namespace:   System.Text
Assembly:  mscorlib (in mscorlib.dll)

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


Type: System.Char

The high surrogate of the input pair.

Type: System.Char

The low surrogate of the input pair.

Type: System.Int32

The index position of the surrogate pair in the input buffer.

Return Value

Type: System.Boolean

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

Exception Condition

This method is called again before the GetNextChar method has read all the replacement string characters.


The value of charUnknownHigh is less than U+D800 or greater than U+D8FF.


The value of charUnknownLow is less than U+DC00 or greater than U+DFFF.

The GetBytes and Convert methods call Fallback if they encounter an unknown character in their input. If the return value of Fallback is true, the calling method can invoke the GetNextChar method to obtain each character in the replacement fallback buffer.

.NET Framework
Available since 2.0
Return to top