EncoderReplacementFallbackBuffer 類別


表示在無法為原始輸入字元編碼時,所使用的替代輸入字串。Represents a substitute input string that is used when the original input character cannot be encoded. 此類別無法獲得繼承。This class cannot be inherited.

public ref class EncoderReplacementFallbackBuffer sealed : System::Text::EncoderFallbackBuffer
public sealed class EncoderReplacementFallbackBuffer : System.Text.EncoderFallbackBuffer
type EncoderReplacementFallbackBuffer = class
    inherit EncoderFallbackBuffer
Public NotInheritable Class EncoderReplacementFallbackBuffer
Inherits EncoderFallbackBuffer


如果沒有適當的編碼存在,可能無法將字元轉換為對等編碼的位元組序列。It might not be possible to convert a character to an equivalent encoded byte sequence if no suitable encoding exists. 編碼失敗的常見原因是,轉換作業所使用的字碼頁無法代表要編碼的字元。A common reason for an encoding to fail is if the conversion operation uses a code page that cannot represent the character to encode.

如果輸入字元無法轉換為輸出位元組序列,則 System.Text.EncoderReplacementFallback 物件會提供取代原始輸入字元的取代字串。If the input character cannot be converted to an output byte sequence, a System.Text.EncoderReplacementFallback object provides a replacement string that is substituted for the original input character. 取代字串會初始化物件的值 EncoderReplacementFallback ,而物件的值會 EncoderReplacementFallback 初始化物件的值 EncoderReplacementFallbackBufferThe replacement string initializes the value of the EncoderReplacementFallback object, and the value of the EncoderReplacementFallback object initializes the value of an EncoderReplacementFallbackBuffer object. 物件的值 EncoderReplacementFallbackBuffer 稱為取代回溯緩衝區。The value of an EncoderReplacementFallbackBuffer object is called the replacement fallback buffer. 轉換作業會將取代回緩衝區(而不是原始輸入字元)編碼,然後繼續處理輸入的其餘部分。The conversion operation encodes the replacement fallback buffer instead of the original input character, then continues to process the remainder of the input.



使用 EncoderReplacementFallbackBuffer 物件的值,初始化 EncoderReplacementFallback 類別的新執行個體。Initializes a new instance of the EncoderReplacementFallbackBuffer class using the value of a EncoderReplacementFallback object.



取得在取代後援緩衝區中仍然要處理的字元數。Gets the number of characters in the replacement fallback buffer that remain to be processed.



判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Fallback(Char, Char, Int32)

指示在無法編碼輸入 Surrogate 字組時,是否可以使用取代字串,以及是否可以忽略 Surrogate 字組。Indicates whether a replacement string can be used when an input surrogate pair cannot be encoded, or whether the surrogate pair can be ignored. 參數會在輸入中指定 Surrogate 字組以及此字組的索引位置。Parameters specify the surrogate pair and the index position of the pair in the input.

Fallback(Char, Int32)

預備取代後援緩衝區來使用目前的取代字串。Prepares the replacement fallback buffer to use the current replacement string.


做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)

擷取取代後援緩衝區中的下一個字元。Retrieves the next character in the replacement fallback buffer.


取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)

使得 GetNextChar() 方法的下一個呼叫存取在取代後援緩衝區中的目前字元位置之前的字元位置。Causes the next call to the GetNextChar() method to access the character position in the replacement fallback buffer prior to the current character position.


初始化這個 EncoderReplacementFallbackBuffer 執行個體中的所有內部狀態資訊和資料。Initializes all internal state information and data in this instance of EncoderReplacementFallbackBuffer.


傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)