<PackageReference Include="System.Text.Encodings.Web" Version="10.0.0-preview.3.25171.5" />

JavaScriptEncoder

public abstract class JavaScriptEncoder : TextEncoder
Represents a JavaScript character encoding.
public static JavaScriptEncoder Default { get; }

Gets a built-in instance of the JavaScriptEncoder class.

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

protected JavaScriptEncoder()

Initializes a new instance of the JavaScriptEncoder class.

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

public static JavaScriptEncoder Create(UnicodeRange[] allowedRanges)

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