Adding reference source for System.Net
[mono.git] / mcs / class / referencesource / System / net / System / Net / UnicodeEncodingConformance.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="UnicodeEncodingConformance.cs" company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 using System;
8 using System.Diagnostics.CodeAnalysis;
9
10 namespace System.Net.Configuration
11 {
12     /// <summary>
13     /// Controls how Unicode characters are output by the WebUtility.HtmlEncode routine.
14     /// </summary>
15     /// <remarks>
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.
18     /// </remarks>
19     public enum UnicodeEncodingConformance
20     {
21         /// <summary>
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.
25         /// </summary>
26         Auto,
27
28         /// <summary>
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 "&amp;#144308;".
32         /// </summary>
33         /// <remarks>
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.
37         /// </remarks>
38         Strict,
39
40         /// <summary>
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).
44         /// </summary>
45         [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Compat", Justification="Shorthand for 'compatibility mode'.")]
46         Compat,
47     }
48
49 }