UTF8Encoding Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a UTF-8 encoding of Unicode characters.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

public class UTF8Encoding : Encoding

The UTF8Encoding type exposes the following members.

  NameDescription
Public methodUTF8EncodingInitializes a new instance of the UTF8Encoding class.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBytes(String)Encodes the characters in a specified String object into a sequence of bytes. (Overrides Encoding..::..GetBytes(String).)
Public methodGetBytes(String, Int32, Int32, array<Byte>[]()[][], Int32)Encodes a set of characters from the specified String into the specified byte array. (Overrides Encoding..::..GetBytes(String, Int32, Int32, array<Byte>[]()[][], Int32).)
Public methodGetChars(array<Byte>[]()[][])Decodes a byte array into an array of characters. (Overrides Encoding..::..GetChars(array<Byte>[]()[][]).)
Public methodGetChars(array<Byte>[]()[][], Int32, Int32)Decodes a sequence of bytes from the specified byte array into a set of characters. (Overrides Encoding..::..GetChars(array<Byte>[]()[][], Int32, Int32).)
Public methodGetDecoderObtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters. (Overrides Encoding..::..GetDecoder()()()().)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Encoding is the process of transforming a set of Unicode characters into a sequence of bytes. Decoding is the process of transforming a sequence of encoded bytes into a set of Unicode characters.

UTF-8 encoding represents each code point as a sequence of one to four bytes.

The encoder can use the big endian byte order (most significant byte first) or the little endian byte order (least significant byte first). It is generally more efficient to store Unicode characters using the native byte order. For example, it is better to use the little endian byte order on little endian platforms, such as Intel computers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: