Επεξεργασία

Κοινή χρήση μέσω


EncoderReplacementFallbackBuffer.Fallback Method

Definition

Prepares the replacement fallback buffer to use the current replacement string.

Overloads

Fallback(Char, Int32)

Prepares the replacement fallback buffer to use the current replacement string.

Fallback(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.

Fallback(Char, Int32)

Source:
EncoderReplacementFallback.cs
Source:
EncoderReplacementFallback.cs
Source:
EncoderReplacementFallback.cs

Prepares the replacement fallback buffer to use the current replacement string.

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. This parameter is ignored in this operation unless an exception is thrown.

index
Int32

The index position of the character in the input buffer. This parameter is ignored in this operation.

Returns

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

Exceptions

This method is called again before the GetNextChar() method has read all the characters in the replacement fallback buffer.

Remarks

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.

Applies to

Fallback(Char, Char, Int32)

Source:
EncoderReplacementFallback.cs
Source:
EncoderReplacementFallback.cs
Source:
EncoderReplacementFallback.cs

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.

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

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

Exceptions

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.

-or-

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

Remarks

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.

Applies to