Class OdfBig5EEncoding
Provides a table-driven Big5E character encoding. 提供由對照表驅動的 Big5E 字元編碼。
public sealed class OdfBig5EEncoding : Encoding, ICloneable
- Inheritance
-
OdfBig5EEncoding
- Implements
- Inherited Members
Remarks
The CLI does not provide this encoding. Build it from CNS mapping data by calling Parse(TextReader) for two tables, then JoinOnCns(IReadOnlyDictionary<string, int>, IReadOnlyDictionary<string, int>), and finally Create(IReadOnlyDictionary<int, int>). CLI 未內建此編碼。使用者可針對兩份全字庫對照表呼叫 Parse(TextReader),再依序呼叫 JoinOnCns(IReadOnlyDictionary<string, int>, IReadOnlyDictionary<string, int>) 與 Create(IReadOnlyDictionary<int, int>) 自行建立。
Properties
EncodingName
Gets the human-readable name of this encoding. 取得此編碼的人類可讀名稱。
public override string EncodingName { get; }
Property Value
WebName
Gets the web name registered for this encoding. 取得此編碼所登錄的網頁名稱。
public override string WebName { get; }
Property Value
Methods
Create(IReadOnlyDictionary<int, int>)
Creates a Big5E encoding from a Unicode-to-Big5E mapping. 從 Unicode 至 Big5E 對應表建立 Big5E 編碼。
public static OdfBig5EEncoding Create(IReadOnlyDictionary<int, int> unicodeToBig5E)
Parameters
unicodeToBig5EIReadOnlyDictionary<int, int>The Unicode-scalar-to-Big5E-code mapping. / Unicode 純量值至 Big5E 碼的對應表。
Returns
- OdfBig5EEncoding
A table-driven Big5E encoding. / 由對照表驅動的 Big5E 編碼。
Exceptions
- ArgumentNullException
- ArgumentException
The mapping is empty or contains an invalid Unicode scalar or Big5E code. / 對應表為空,或包含無效的 Unicode 純量值或 Big5E 碼。
GetByteCount(char[], int, int)
Calculates the number of bytes produced by encoding a character array segment. 計算字元陣列區段編碼後產生的位元組數量。
public override int GetByteCount(char[] chars, int index, int count)
Parameters
charschar[]The character array to encode. / 要編碼的字元陣列。
indexintThe starting character index. / 起始字元索引。
countintThe number of characters to encode. / 要編碼的字元數量。
Returns
- int
The required byte count. / 所需的位元組數量。
GetBytes(char[], int, int, byte[], int)
Encodes a character array segment into a byte array. 將字元陣列區段編碼至位元組陣列。
public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
Parameters
charschar[]The character array to encode. / 要編碼的字元陣列。
charIndexintThe starting character index. / 起始字元索引。
charCountintThe number of characters to encode. / 要編碼的字元數量。
bytesbyte[]The destination byte array. / 目的位元組陣列。
byteIndexintThe starting destination index. / 目的陣列的起始索引。
Returns
- int
The number of bytes written. / 寫入的位元組數量。
GetCharCount(byte[], int, int)
Calculates the number of characters produced by decoding a byte array segment. 計算位元組陣列區段解碼後產生的字元數量。
public override int GetCharCount(byte[] bytes, int index, int count)
Parameters
bytesbyte[]The byte array to decode. / 要解碼的位元組陣列。
indexintThe starting byte index. / 起始位元組索引。
countintThe number of bytes to decode. / 要解碼的位元組數量。
Returns
- int
The required character count. / 所需的字元數量。
GetChars(byte[], int, int, char[], int)
Decodes a byte array segment into a character array. 將位元組陣列區段解碼至字元陣列。
public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
Parameters
bytesbyte[]The byte array to decode. / 要解碼的位元組陣列。
byteIndexintThe starting byte index. / 起始位元組索引。
byteCountintThe number of bytes to decode. / 要解碼的位元組數量。
charschar[]The destination character array. / 目的字元陣列。
charIndexintThe starting destination index. / 目的陣列的起始索引。
Returns
- int
The number of characters written. / 寫入的字元數量。
GetDecoder()
Creates a stateful decoder for block-based conversion. 建立用於區塊式轉換的具狀態解碼器。
public override Decoder GetDecoder()
Returns
- Decoder
A stateful Big5E decoder. / 具狀態的 Big5E 解碼器。
GetEncoder()
Creates a stateful encoder for block-based conversion. 建立用於區塊式轉換的具狀態編碼器。
public override Encoder GetEncoder()
Returns
- Encoder
A stateful Big5E encoder. / 具狀態的 Big5E 編碼器。
GetMaxByteCount(int)
Gets a safe upper bound for bytes produced from a character count. 取得指定字元數量可能產生之位元組數量的安全上限。
public override int GetMaxByteCount(int charCount)
Parameters
charCountintThe input character count. / 輸入字元數量。
Returns
- int
A safe maximum byte count. / 安全的最大位元組數量。
GetMaxCharCount(int)
Gets a safe upper bound for characters produced from a byte count. 取得指定位元組數量可能產生之字元數量的安全上限。
public override int GetMaxCharCount(int byteCount)
Parameters
byteCountintThe input byte count. / 輸入位元組數量。
Returns
- int
A safe maximum character count. / 安全的最大字元數量。