System.Text.EncoderFallbackBuffer Class

Provides a buffer that allows a fallback handler to return an alternate string to an encoder when it cannot encode an input character.

See Also: EncoderFallbackBuffer Members

Syntax

public abstract class EncoderFallbackBuffer

Remarks

An encoding defines a mapping between a Unicode character and an encoded sequence of bytes. An encoding operation, which converts an input character to an output byte sequence, fails if no mapping is defined for a particular character.

The .NET Framework provides a failure handling mechanism, called a fallback, if a conversion cannot be performed. All encoder fallback handlers must implement the following:

Fallbacks can use three strategies to handle conversion failures:

The buffer in an System.Text.EncoderFallbackBuffer implementation represents the entire string to be returned to the encoder in response to an encoder fallback. Generally, implementations also include state information, such as the index of the next character to return to the encoder and the number of remaining characters to be returned. Because System.Text.EncoderFallbackBuffer is an abstract class, it requires derived classes to implement the following members at a minimum:

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0