EncoderExceptionFallbackBuffer.Fallback Method (Char, Char, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the surrogate pair in the input, and the nominal return value is not used.

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

None. No value is returned because the Fallback method always throws an exception.

Exception Condition

The character represented by charUnknownHigh and charUnknownLow cannot be encoded.


Either charUnknownHigh or charUnknownLow is invalid. charUnknownHigh is not between U+D800 and U+DBFF, inclusive, or charUnknownLow is not between U+DC00 and U+DFFF, inclusive.

The GetBytes and Convert methods call Fallback if they encounter a surrogate pair in their input. In response, Fallback always throws an exception.

.NET Framework
Available since 2.0
Return to top