

UTF-8 encodes Unicode characters with a variable number of bytes per character. The UTF8Encoding.GetPreamble method can obtain a Unicode byte order mark, which when prefixed to a series of bytes, indicates how those bytes are encoded.

The UTF8Encoding.GetDecoder method obtains an object to convert (decode) UTF-8 encoded bytes into Unicode characters, while the UTF8Encoding.GetEncoder method obtains an object to convert (encode) Unicode characters into UTF-8 encoded bytes. The UTF8Encoding.GetByteCount method reports the number of bytes that result from encoding strings or arrays of Unicode characters, and the UTF8Encoding.GetBytes method actually encodes characters into an array of bytes. This class contains the UTF8Encoding.GetCharCount method that reports the number of Unicode characters that result from decoding an array of bytes, and the UTF8Encoding.GetChars method that actually decodes an array of bytes. For more information regarding surrogate pairs, see UnicodeCategory. This encoding supports all Unicode character values and surrogates. Remarks This class encodes Unicode characters using UCS Transformation Format, 8-bit form (UTF-8). Summary Represents a UTF-8 encoding of Unicode characters.

Type: 8Encoding 8Encoding Class Assembly: Mscorlib.dll
