This documentation is archived and is not being maintained.

Encoding.GetEncoder Method

An Encoder for this encoding.

[Visual Basic]
Public Overridable Function GetEncoder() As Encoder
public virtual Encoder GetEncoder();
public: virtual Encoder* GetEncoder();
public function GetEncoder() : Encoder;

Return Value

An Encoder for this encoding. The Encoder can be used to encode a sequence of characters into bytes.


Contrary to GetBytes, an Encoder can convert partial sequences of characters into partial sequences of bytes by maintaining the appropriate state between the conversions.

This default implementation returns an Encoder that forwards calls to GetByteCount and GetBytes to the corresponding methods of this encoding. Encodings that require state to be maintained between successive conversions can override this method and return an instance of an appropriate Encoder implementation.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Encoding Class | Encoding Members | System.Text Namespace