Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

UnicodeEncodingConformance Enumeration

.NET Framework 4.5

Controls how Unicode characters are output by the HtmlEncode methods.

Namespace:  System.Net.Configuration
Assembly:  System (in System.dll)
public enum UnicodeEncodingConformance
Member nameDescription
AutoUse automatic behavior. The Unicode encoding behavior is determined by current application's target Framework. For .NET Framework 4.5 and later, the Unicode encoding behavior is strict.       
CompatUse compatible behavior. Specifies that individual UTF-16 surrogate code points are output as-is when one of HtmlEncode methods is called. For example, given a string "\uD84C\uDFB4" (or "\U000233B4"), the output of HtmlEncode is "\uD84C\uDFB4" (the input is not encoded).
StrictUse strict behavior. Specifies that individual UTF-16 surrogate code points are combined into a single code point when one of the HtmlEncode methods is called. For example, given the input string "\uD84C\uDFB4" (or "\U000233B4"), the output of the HtmlEncode methods is "𣎴". If the input is a malformed UTF-16 string (it contains unpaired surrogates, for example), the bad code points will be replaced with U+FFFD (Unicode replacement char) before being HTML-encoded.

For more information on how Unicode characters are supposed to be encoded in HTML, see Using character escapes in markup and CSS.

.NET Framework

Supported in: 4.5.1, 4.5

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft. All rights reserved.