Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

EncoderFallbackBuffer Class

Note: This class is new in the .NET Framework version 2.0.

Passes a substitute string to an encoding operation. The string is used in place of any input character that cannot be encoded.

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

public abstract class EncoderFallbackBuffer
public abstract class EncoderFallbackBuffer
public abstract class EncoderFallbackBuffer

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

The .NET Framework provides a failure-handling mechanism, called a fallback, which is activated if a conversion cannot be performed. Encoder fallbacks can employ various strategies. However, all encoder fallbacks must implement an encoder fallback buffer, which is represented by a type derived from the EncoderFallbackBuffer class, and which is used to pass a string to the conversion operation. For example, the fallback buffer for an encoder replacement fallback emits a substitute string if an input character cannot be encoded.

A fallback buffer is required even if the strategy implemented by a particular fallback does not require emitting data. For example, the fallback buffer for an encoder or decoder exception fallback is never accessed, because the fallback throws an exception instead of producing output.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.