Editar

Partilhar via


EncoderExceptionFallbackBuffer.Fallback Method

Definition

Throws an exception because the input character cannot be encoded. The nominal return value is not used.

Overloads

Fallback(Char, Int32)

Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the character that cannot be converted.

Fallback(Char, Char, Int32)

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.

Fallback(Char, Int32)

Source:
EncoderExceptionFallback.cs
Source:
EncoderExceptionFallback.cs
Source:
EncoderExceptionFallback.cs

Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the character that cannot be converted.

public:
 override bool Fallback(char charUnknown, int index);
public override bool Fallback (char charUnknown, int index);
override this.Fallback : char * int -> bool
Public Overrides Function Fallback (charUnknown As Char, index As Integer) As Boolean

Parameters

charUnknown
Char

An input character.

index
Int32

The index position of the character in the input buffer.

Returns

None. No value is returned because the Fallback(Char, Int32) method always throws an exception.

Exceptions

charUnknown cannot be encoded. This method always throws an exception that reports the value of the charUnknown and index parameters.

Remarks

The GetBytes and Convert methods call Fallback if they encounter an unknown character in their input. In response, Fallback always throws EncoderFallbackException.

Applies to

Fallback(Char, Char, Int32)

Source:
EncoderExceptionFallback.cs
Source:
EncoderExceptionFallback.cs
Source:
EncoderExceptionFallback.cs

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.

public:
 override bool Fallback(char charUnknownHigh, char charUnknownLow, int index);
public override bool Fallback (char charUnknownHigh, char charUnknownLow, int index);
override this.Fallback : char * char * int -> bool
Public Overrides Function Fallback (charUnknownHigh As Char, charUnknownLow As Char, index As Integer) As Boolean

Parameters

charUnknownHigh
Char

The high surrogate of the input pair.

charUnknownLow
Char

The low surrogate of the input pair.

index
Int32

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

Returns

None. No value is returned because the Fallback(Char, Char, Int32) method always throws an exception.

Exceptions

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.

Remarks

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

Applies to