Share via


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.

Inheritance Hierarchy

System. . :: . .Object
  System.Text. . :: . .Encoding
    System.Text..::..UTF8Encoding

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

Syntax

'Declaration
Public Class UTF8Encoding _
    Inherits Encoding
public class UTF8Encoding : Encoding
public ref class UTF8Encoding : public Encoding
type UTF8Encoding =  
    class
        inherit Encoding
    end
public class UTF8Encoding extends Encoding

The UTF8Encoding type exposes the following members.

Constructors

  Name Description
Public method UTF8Encoding Initializes a new instance of the UTF8Encoding class.

Top

Methods

  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetBytes(String) Encodes the characters in a specified String object into a sequence of bytes. (Overrides Encoding. . :: . .GetBytes(String).)
Public method GetBytes(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 method GetChars(array<Byte> [] () [] []) Decodes a byte array into an array of characters. (Overrides Encoding. . :: . .GetChars(array<Byte> [] () [] []).)
Public method GetChars(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 method GetDecoder Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters. (Overrides Encoding. . :: . .GetDecoder() () () ().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

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.

Thread Safety

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

See Also

Reference

System.Text Namespace