Muokkaa

Jaa


JavaScriptEncoder.UnsafeRelaxedJsonEscaping Property

Definition

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