Encoding Class

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

Represents a character encoding.

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

[<AbstractClass>]
[<SerializableAttribute>]
type Encoding =  class end

The Encoding type exposes the following members.

  NameDescription
Protected methodEncodingInitializes a new instance of the Encoding class.
Top

  NameDescription
Public propertyStatic memberUTF8Gets an encoding for the UTF-8 format.
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)When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.
Public methodGetBytes(String, Int32, Int32, array<Byte>[]()[][], Int32)When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.
Public methodGetChars(array<Byte>[]()[][])When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters.
Public methodGetChars(array<Byte>[]()[][], Int32, Int32)When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters.
Public methodGetDecoderWhen overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.
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. In contrast, decoding is the process of transforming a sequence of encoded bytes into a set of Unicode characters.

The Encoding class is primarily intended to convert between different encodings and Unicode. Often one of the derived Unicode classes is the correct choice for your application.

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: