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.
Inheritance Hierarchy
System. . :: . .Object
System.Text..::..Encoding
System.Text. . :: . .UTF8Encoding
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
<SerializableAttribute> _
Public MustInherit Class Encoding
[SerializableAttribute]
public abstract class Encoding
[SerializableAttribute]
public ref class Encoding abstract
[<AbstractClass>]
[<SerializableAttribute>]
type Encoding = class end
public abstract class Encoding
The Encoding type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Encoding | Initializes a new instance of the Encoding class. |
Top
Properties
Name | Description | |
---|---|---|
UTF8 | Gets an encoding for the UTF-8 format. |
Top
Methods
Name | Description | |
---|---|---|
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetBytes(String) | When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes. | |
GetBytes(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. | |
GetChars(array<Byte> [] () [] []) | When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters. | |
GetChars(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. | |
GetDecoder | When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
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. 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.
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.