EncoderExceptionFallbackBuffer.Fallback 方法

定义

因为无法对输入字符进行编码而引发异常。Throws an exception because the input character cannot be encoded. 不使用名义返回值。The nominal return value is not used.

重载

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)

因为无法对输入字符进行编码而引发异常。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

参数

charUnknown
Char

一个输入字符。An input character.

index
Int32

该字符在输入缓冲区中的索引位置。The index position of the character in the input buffer.

返回

Boolean

无。None. 不返回值,因为 Fallback(Char, Int32) 方法始终引发异常。No value is returned because the Fallback(Char, Int32) method always throws an exception.

例外

无法对 charUnknown 进行编码。charUnknown cannot be encoded. 此方法始终引发异常,该异常报告 charUnknownindex 参数的值。This method always throws an exception that reports the value of the charUnknown and index parameters.

注解

GetBytes如果和 Convert 方法 Fallback 在输入中遇到未知字符,则调用。The GetBytes and Convert methods call Fallback if they encounter an unknown character in their input. 在响应中, Fallback 始终引发 EncoderFallbackExceptionIn response, Fallback always throws EncoderFallbackException.

适用于

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.

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

参数

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.

返回

Boolean

无。None. 不返回值,因为 Fallback(Char, Char, Int32) 方法始终引发异常。No value is returned because the Fallback(Char, Char, Int32) method always throws an exception.

例外

无法对由 charUnknownHighcharUnknownLow 表示的字符进行编码。The character represented by charUnknownHigh and charUnknownLow cannot be encoded.

charUnknownHighcharUnknownLow 是无效的。Either charUnknownHigh or charUnknownLow is invalid. charUnknownHigh 不介于 U+D800 和 U+DBFF 之间(包括这两者),或者 charUnknownLow 不介于 U+DC00 和 U+DFFF 之间(包括这两者)。charUnknownHigh is not between U+D800 and U+DBFF, inclusive, or charUnknownLow is not between U+DC00 and U+DFFF, inclusive.

注解

GetBytes如果和 Convert 方法 Fallback 在其输入中遇到代理项对,则调用。The GetBytes and Convert methods call Fallback if they encounter a surrogate pair in their input. 在响应中, Fallback 始终引发异常。In response, Fallback always throws an exception.

适用于