1 //------------------------------------------------------------------------------
2 // <copyright file="UnicodeEncodingConformance.cs" company="Microsoft Corporation">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
8 using System.Diagnostics.CodeAnalysis;
10 namespace System.Net.Configuration
13 /// Controls how Unicode characters are output by the WebUtility.HtmlEncode routine.
16 /// See http://www.w3.org/International/questions/qa-escapes#bytheway for more information
17 /// on how Unicode characters in the SMP are supposed to be encoded in HTML.
19 public enum UnicodeEncodingConformance
22 /// The Unicode encoding behavior is determined by current application's
23 /// TargetFrameworkAttribute. Framework40 and earlier gets Compat behavior; Framework45
24 /// and later gets Strict behavior.
29 /// Specifies that individual UTF-16 surrogate code points are combined into a single
30 /// SMP code point when a call to HtmlEncode takes place. For example, given the input
31 /// string "\uD84C\uDFB4" (or "\U000233B4"), the output of HtmlEncode is "&#144308;".
34 /// If the input is a malformed UTF-16 string, e.g. it contains unpaired surrogates,
35 /// the bad code points will be replaced with U+FFFD (Unicode replacement char) before
36 /// being HTML-encoded.
41 /// Specifies that individual UTF-16 surrogate code points are output as-is when a call to
42 /// HtmlEncode takes place. For example, given a string "\uD84C\uDFB4" (or "\U000233B4"),
43 /// the output of HtmlEncode is "\uD84C\uDFB4" (the input is not encoded).
45 [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Compat", Justification="Shorthand for 'compatibility mode'.")]