Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DecoderFallbackBuffer::Fallback Method (array<Byte>^, Int32)

 

When overridden in a derived class, prepares the fallback buffer to handle the specified input byte sequence.

Namespace:   System.Text
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual bool Fallback(
	array<unsigned char>^ bytesUnknown,
	int index
) abstract

Parameters

bytesUnknown
Type: array<System::Byte>^

An input array of bytes.

index
Type: System::Int32

The index position of a byte in bytesUnknown.

Return Value

Type: System::Boolean

true if the fallback buffer can process bytesUnknown; false if the fallback buffer ignores bytesUnknown.

The Encoding::GetChars, Encoding::GetString, and Decoder::Convert methods call Fallback if they encounter an unknown input byte sequence that cannot be decoded. A return value of true indicates that the fallback buffer can process the input byte sequence, which causes the calling method to call the GetNextChar method to obtain each character of the fallback buffer. Because it does not process individual bytes, the Fallback method in an exception fallback handler throws an exception.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft