HtmlEncoder 類別
定義
表示 HTML 字元編碼方式。Represents an HTML character encoding.
public ref class HtmlEncoder abstract : System::Text::Encodings::Web::TextEncoder
public abstract class HtmlEncoder : System.Text.Encodings.Web.TextEncoder
type HtmlEncoder = class
inherit TextEncoder
Public MustInherit Class HtmlEncoder
Inherits TextEncoder
- 繼承
- 衍生
備註
此類型的原始程式碼可在 GitHub 上的system.Web 專案中取得。The source code for this type is available in the System.Text.Encodings.Web project on GitHub. 也可以做為程式碼範例的單元測試, 可在 GitHub 上的system.web/測試資料夾中找到。Unit tests that can also serve as code examples are found in the System.Text.Encodings.Web/tests folder on GitHub.
建構函式
HtmlEncoder() |
初始化 HtmlEncoder 類別的新執行個體。Initializes a new instance of the HtmlEncoder class. |
屬性
Default |
取得 HtmlEncoder 類別的內建執行個體。Gets a built-in instance of the HtmlEncoder class. |
MaxOutputCharactersPerInputCharacter |
取得此編碼器可為每個字碼指標產生的字元數上限。Gets the maximum number of characters that this encoder can generate for each input code point. (繼承來源 TextEncoder) |
方法
Create(TextEncoderSettings) |
使用指定設定建立 HtmlEncoder 類別的新執行個體。Creates a new instance of the HtmlEncoder class with the specified settings. |
Create(UnicodeRange[]) |
建立 HtmlEncoder 類別的新執行個體,指定允許編碼器不編碼的字元。Creates a new instance of the HtmlEncoder class that specifies characters the encoder is allowed to not encode. |
Encode(ReadOnlySpan<Char>, Span<Char>, Int32, Int32, Boolean) |
將提供的字元編碼。Encodes the supplied characters. (繼承來源 TextEncoder) |
Encode(String) |
將提供的字串編碼,並傳回編碼後的文字當成新字串。Encodes the supplied string and returns the encoded text as a new string. (繼承來源 TextEncoder) |
Encode(TextWriter, Char[], Int32, Int32) |
編碼陣列的字元,並將其寫入 TextWriter 物件。Encodes characters from an array and writes them to a TextWriter object. (繼承來源 TextEncoder) |
Encode(TextWriter, String) |
將指定的字串編碼至 TextWriter 物件。Encodes the specified string to a TextWriter object. (繼承來源 TextEncoder) |
Encode(TextWriter, String, Int32, Int32) |
編碼子字串,並將它寫入 TextWriter 物件。Encodes a substring and writes it to a TextWriter object. (繼承來源 TextEncoder) |
EncodeUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean) |
為提供的 UTF-8 文字編碼。Encodes the supplied UTF-8 text. (繼承來源 TextEncoder) |
Equals(Object) |
判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object. (繼承來源 Object) |
FindFirstCharacterToEncode(Char*, Int32) |
尋找第一個字元的索引以進行編碼。Finds the index of the first character to encode. (繼承來源 TextEncoder) |
FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>) |
尋找 UTF-8 文字輸入緩衝區的第一個元素,目前的編碼器會使其逸出。Finds the first element in a UTF-8 text input buffer that would be escaped by the current encoder instance. (繼承來源 TextEncoder) |
GetHashCode() |
作為預設雜湊函數。Serves as the default hash function. (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。Gets the Type of the current instance. (繼承來源 Object) |
MemberwiseClone() |
建立目前 Object 的淺層複製。Creates a shallow copy of the current Object. (繼承來源 Object) |
ToString() |
傳回代表目前物件的字串。Returns a string that represents the current object. (繼承來源 Object) |
TryEncodeUnicodeScalar(Int32, Char*, Int32, Int32) |
編碼 Unicode 純量值,並將它寫入緩衝區。Encodes a Unicode scalar value and writes it to a buffer. (繼承來源 TextEncoder) |
WillEncode(Int32) |
判斷指定的 Unicode 純量值是否要進行編碼。Determines if a given Unicode scalar value will be encoded. (繼承來源 TextEncoder) |