Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

JavaScriptEncoder.UnsafeRelaxedJsonEscaping Property

Definition

Namespace:
System.Text.Encodings.Web
Assembly:
System.Text.Encodings.Web.dll
Package:
System.Text.Encodings.Web v11.0.0-preview.5.26302.115
Source:
JavaScriptEncoder.cs
Source:
JavaScriptEncoder.cs
Source:
JavaScriptEncoder.cs
Source:
JavaScriptEncoder.cs
Source:
JavaScriptEncoder.cs
Source:
JavaScriptEncoder.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public:
 static property System::Text::Encodings::Web::JavaScriptEncoder ^ UnsafeRelaxedJsonEscaping { System::Text::Encodings::Web::JavaScriptEncoder ^ get(); };
public static System.Text.Encodings.Web.JavaScriptEncoder UnsafeRelaxedJsonEscaping { get; }
static member UnsafeRelaxedJsonEscaping : System.Text.Encodings.Web.JavaScriptEncoder
Public Shared ReadOnly Property UnsafeRelaxedJsonEscaping As JavaScriptEncoder

Property Value

A JavaScript encoder instance.

Remarks

Unlike the Default encoder, this encoder instance does not escape HTML-sensitive characters such as <, >, &. As a result, it must be used cautiously; for example, it can be used if the output data is within a response whose content-type is known with a charset set to UTF-8.

Unlike the Default encoding, the quotation mark is encoded as \" rather than \u0022.

Unlike the Default encoding (which only allows UnicodeRanges.BasicLatin), using this encoder instance allows UnicodeRanges.All to go through unescaped.

Unlike the Default encoder, this encoder instance allows some other characters (such as '+') to go through unescaped and therefore must be used cautiously.

For more information about why this could be unsafe, see Serialize all characters.

Applies to


Feedback

Was this page helpful?