JavaScriptEncoder JavaScriptEncoder JavaScriptEncoder JavaScriptEncoder Class

Definition

Represents a JavaScript character encoding.

public ref class JavaScriptEncoder abstract : System::Text::Encodings::Web::TextEncoder
public abstract class JavaScriptEncoder : System.Text.Encodings.Web.TextEncoder
type JavaScriptEncoder = class
    inherit TextEncoder
Public MustInherit Class JavaScriptEncoder
Inherits TextEncoder
Inheritance
JavaScriptEncoderJavaScriptEncoderJavaScriptEncoderJavaScriptEncoder
Derived

Remarks

The source code for this type is available in the System.Text.Encodings.Web project on GitHub. Unit tests that can also serve as code examples are found in the System.Text.Encodings.Web/tests folder on GitHub.

Constructors

JavaScriptEncoder() JavaScriptEncoder() JavaScriptEncoder() JavaScriptEncoder()

Initializes a new instance of the JavaScriptEncoder class.

Properties

Default Default Default Default

Gets a built-in instance of the JavaScriptEncoder class.

MaxOutputCharactersPerInputCharacter MaxOutputCharactersPerInputCharacter MaxOutputCharactersPerInputCharacter MaxOutputCharactersPerInputCharacter

Gets the maximum number of characters that this encoder can generate for each input code point.

(Inherited from TextEncoder)
UnsafeRelaxedJsonEscaping UnsafeRelaxedJsonEscaping UnsafeRelaxedJsonEscaping UnsafeRelaxedJsonEscaping

Gets a built-in JavaScript encoder instance that is less strict about what is encoded.

Methods

Create(TextEncoderSettings) Create(TextEncoderSettings) Create(TextEncoderSettings) Create(TextEncoderSettings)

Creates a new instance of JavaScriptEncoder class with the specified settings.

Create(UnicodeRange[]) Create(UnicodeRange[]) Create(UnicodeRange[]) Create(UnicodeRange[])

Creates a new instance of the JavaScriptEncoder class that specifies characters the encoder is allowed to not encode.

Encode(ReadOnlySpan<Char>, Span<Char>, Int32, Int32, Boolean) Encode(ReadOnlySpan<Char>, Span<Char>, Int32, Int32, Boolean) Encode(ReadOnlySpan<Char>, Span<Char>, Int32, Int32, Boolean) Encode(ReadOnlySpan<Char>, Span<Char>, Int32, Int32, Boolean)

Encodes the supplied characters.

(Inherited from TextEncoder)
Encode(String) Encode(String) Encode(String) Encode(String)

Encodes the supplied string and returns the encoded text as a new string.

(Inherited from TextEncoder)
Encode(TextWriter, Char[], Int32, Int32) Encode(TextWriter, Char[], Int32, Int32) Encode(TextWriter, Char[], Int32, Int32) Encode(TextWriter, Char[], Int32, Int32)

Encodes characters from an array and writes them to a TextWriter object.

(Inherited from TextEncoder)
Encode(TextWriter, String) Encode(TextWriter, String) Encode(TextWriter, String) Encode(TextWriter, String)

Encodes the specified string to a TextWriter object.

(Inherited from TextEncoder)
Encode(TextWriter, String, Int32, Int32) Encode(TextWriter, String, Int32, Int32) Encode(TextWriter, String, Int32, Int32) Encode(TextWriter, String, Int32, Int32)

Encodes a substring and writes it to a TextWriter object.

(Inherited from TextEncoder)
EncodeUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean) EncodeUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean) EncodeUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean) EncodeUtf8(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Boolean)

Encodes the supplied UTF-8 text.

(Inherited from TextEncoder)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindFirstCharacterToEncode(Char*, Int32) FindFirstCharacterToEncode(Char*, Int32) FindFirstCharacterToEncode(Char*, Int32) FindFirstCharacterToEncode(Char*, Int32)

Finds the index of the first character to encode.

(Inherited from TextEncoder)
FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>) FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>) FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>) FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>)

Finds the first element in a UTF-8 text input buffer that would be escaped by the current encoder instance.

(Inherited from TextEncoder)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryEncodeUnicodeScalar(Int32, Char*, Int32, Int32) TryEncodeUnicodeScalar(Int32, Char*, Int32, Int32) TryEncodeUnicodeScalar(Int32, Char*, Int32, Int32) TryEncodeUnicodeScalar(Int32, Char*, Int32, Int32)

Encodes a Unicode scalar value and writes it to a buffer.

(Inherited from TextEncoder)
WillEncode(Int32) WillEncode(Int32) WillEncode(Int32) WillEncode(Int32)

Determines if a given Unicode scalar value will be encoded.

(Inherited from TextEncoder)

Applies to