EncoderExceptionFallbackBuffer.Fallback Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- 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
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- 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
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: