BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 This type is safe for multithreaded operations. System.Object System.ICloneable System.Runtime.InteropServices.ComVisible(true)

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. For information about the Unicode Transformation Formats (UTFs) and other encodings supported by , see Understanding Encodings.

Note that is intended to operate on Unicode characters instead of arbitrary binary data, such as byte arrays. If your application must encode arbitrary binary data into text, it should use a protocol such as uuencode, which is implemented by methods such as .

The .NET Framework provides the following implementations of the class to support current Unicode encodings and other encodings:

encodes Unicode characters as single 7-bit ASCII characters. This encoding only supports character values between U+0000 and U+007F. Code page 20127. Also available through the property.

encodes Unicode characters using the UTF-7 encoding. This encoding supports all Unicode character values. Code page 65000. Also available through the property.

encodes Unicode characters using the UTF-8 encoding. This encoding supports all Unicode character values. Code page 65001. Also available through the property.

encodes Unicode characters using the UTF-16 encoding. Both little endian and big endian byte orders are supported. Also available through the property and the property.

encodes Unicode characters using the UTF-32 encoding. Both little endian (code page 12000) and big endian (code page 12001) byte orders are supported. Also available through the property.

The 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.

You use the method to obtain other encodings. You can call the method to get a list of all encodings.

The following table lists the encodings supported by the .NET Framework. It lists each encoding's code page number, along with the values of the encoding's and properties. . An asterisk in the last column indicates that the code page is natively supported by the .NET Framework, regardless of the underlying platform. Note that code pages whose property corresponds to an international standard do not necessarily comply in full with that standard.

Code Page

Name

Display Name

37

IBM037

IBM EBCDIC (US-Canada)

437

IBM437

OEM United States

500

IBM500

IBM EBCDIC (International)

708

ASMO-708

Arabic (ASMO 708)

720

DOS-720

Arabic (DOS)

737

ibm737

Greek (DOS)

775

ibm775

Baltic (DOS)

850

ibm850

Western European (DOS)

852

ibm852

Central European (DOS)

855

IBM855

OEM Cyrillic

857

ibm857

Turkish (DOS)

858

IBM00858

OEM Multilingual Latin I

860

IBM860

Portuguese (DOS)

861

ibm861

Icelandic (DOS)

862

DOS-862

Hebrew (DOS)

863

IBM863

French Canadian (DOS)

864

IBM864

Arabic (864)

865

IBM865

Nordic (DOS)

866

cp866

Cyrillic (DOS)

869

ibm869

Greek, Modern (DOS)

870

IBM870

IBM EBCDIC (Multilingual Latin-2)

874

windows-874

Thai (Windows)

875

cp875

IBM EBCDIC (Greek Modern)

932

shift_jis

Japanese (Shift-JIS)

936

gb2312

Chinese Simplified (GB2312)

*

949

ks_c_5601-1987

Korean

950

big5

Chinese Traditional (Big5)

1026

IBM1026

IBM EBCDIC (Turkish Latin-5)

1047

IBM01047

IBM Latin-1

1140

IBM01140

IBM EBCDIC (US-Canada-Euro)

1141

IBM01141

IBM EBCDIC (Germany-Euro)

1142

IBM01142

IBM EBCDIC (Denmark-Norway-Euro)

1143

IBM01143

IBM EBCDIC (Finland-Sweden-Euro)

1144

IBM01144

IBM EBCDIC (Italy-Euro)

1145

IBM01145

IBM EBCDIC (Spain-Euro)

1146

IBM01146

IBM EBCDIC (UK-Euro)

1147

IBM01147

IBM EBCDIC (France-Euro)

1148

IBM01148

IBM EBCDIC (International-Euro)

1149

IBM01149

IBM EBCDIC (Icelandic-Euro)

1200

utf-16

Unicode

*

1201

unicodeFFFE

Unicode (Big endian)

*

1250

windows-1250

Central European (Windows)

1251

windows-1251

Cyrillic (Windows)

1252

Windows-1252

Western European (Windows)

*

1253

windows-1253

Greek (Windows)

1254

windows-1254

Turkish (Windows)

1255

windows-1255

Hebrew (Windows)

1256

windows-1256

Arabic (Windows)

1257

windows-1257

Baltic (Windows)

1258

windows-1258

Vietnamese (Windows)

1361

Johab

Korean (Johab)

10000

macintosh

Western European (Mac)

10001

x-mac-japanese

Japanese (Mac)

10002

x-mac-chinesetrad

Chinese Traditional (Mac)

10003

x-mac-korean

Korean (Mac)

*

10004

x-mac-arabic

Arabic (Mac)

10005

x-mac-hebrew

Hebrew (Mac)

10006

x-mac-greek

Greek (Mac)

10007

x-mac-cyrillic

Cyrillic (Mac)

10008

x-mac-chinesesimp

Chinese Simplified (Mac)

*

10010

x-mac-romanian

Romanian (Mac)

10017

x-mac-ukrainian

Ukrainian (Mac)

10021

x-mac-thai

Thai (Mac)

10029

x-mac-ce

Central European (Mac)

10079

x-mac-icelandic

Icelandic (Mac)

10081

x-mac-turkish

Turkish (Mac)

10082

x-mac-croatian

Croatian (Mac)

12000

utf-32

Unicode (UTF-32)

*

12001

utf-32BE

Unicode (UTF-32 Big endian)

*

20000

x-Chinese-CNS

Chinese Traditional (CNS)

20001

x-cp20001

TCA Taiwan

20002

x-Chinese-Eten

Chinese Traditional (Eten)

20003

x-cp20003

IBM5550 Taiwan

20004

x-cp20004

TeleText Taiwan

20005

x-cp20005

Wang Taiwan

20105

x-IA5

Western European (IA5)

20106

x-IA5-German

German (IA5)

20107

x-IA5-Swedish

Swedish (IA5)

20108

x-IA5-Norwegian

Norwegian (IA5)

20127

us-ascii

US-ASCII

*

20261

x-cp20261

T.61

20269

x-cp20269

ISO-6937

20273

IBM273

IBM EBCDIC (Germany)

20277

IBM277

IBM EBCDIC (Denmark-Norway)

20278

IBM278

IBM EBCDIC (Finland-Sweden)

20280

IBM280

IBM EBCDIC (Italy)

20284

IBM284

IBM EBCDIC (Spain)

20285

IBM285

IBM EBCDIC (UK)

20290

IBM290

IBM EBCDIC (Japanese katakana)

20297

IBM297

IBM EBCDIC (France)

20420

IBM420

IBM EBCDIC (Arabic)

20423

IBM423

IBM EBCDIC (Greek)

20424

IBM424

IBM EBCDIC (Hebrew)

20833

x-EBCDIC-KoreanExtended

IBM EBCDIC (Korean Extended)

20838

IBM-Thai

IBM EBCDIC (Thai)

20866

koi8-r

Cyrillic (KOI8-R)

20871

IBM871

IBM EBCDIC (Icelandic)

20880

IBM880

IBM EBCDIC (Cyrillic Russian)

20905

IBM905

IBM EBCDIC (Turkish)

20924

IBM00924

IBM Latin-1

20932

EUC-JP

Japanese (JIS 0208-1990 and 0212-1990)

20936

x-cp20936

Chinese Simplified (GB2312-80)

*

20949

x-cp20949

Korean Wansung

*

21025

cp1025

IBM EBCDIC (Cyrillic Serbian-Bulgarian)

21866

koi8-u

Cyrillic (KOI8-U)

28591

iso-8859-1

Western European (ISO)

*

28592

iso-8859-2

Central European (ISO)

28593

iso-8859-3

Latin 3 (ISO)

28594

iso-8859-4

Baltic (ISO)

28595

iso-8859-5

Cyrillic (ISO)

28596

iso-8859-6

Arabic (ISO)

28597

iso-8859-7

Greek (ISO)

28598

iso-8859-8

Hebrew (ISO-Visual)

*

28599

iso-8859-9

Turkish (ISO)

28603

iso-8859-13

Estonian (ISO)

28605

iso-8859-15

Latin 9 (ISO)

29001

x-Europa

Europa

38598

iso-8859-8-i

Hebrew (ISO-Logical)

*

50220

iso-2022-jp

Japanese (JIS)

*

50221

csISO2022JP

Japanese (JIS-Allow 1 byte Kana)

*

50222

iso-2022-jp

Japanese (JIS-Allow 1 byte Kana - SO/SI)

*

50225

iso-2022-kr

Korean (ISO)

*

50227

x-cp50227

Chinese Simplified (ISO-2022)

*

51932

euc-jp

Japanese (EUC)

*

51936

EUC-CN

Chinese Simplified (EUC)

*

51949

euc-kr

Korean (EUC)

*

52936

hz-gb-2312

Chinese Simplified (HZ)

*

54936

GB18030

Chinese Simplified (GB18030)

*

57002

x-iscii-de

ISCII Devanagari

*

57003

x-iscii-be

ISCII Bengali

*

57004

x-iscii-ta

ISCII Tamil

*

57005

x-iscii-te

ISCII Telugu

*

57006

x-iscii-as

ISCII Assamese

*

57007

x-iscii-or

ISCII Oriya

*

57008

x-iscii-ka

ISCII Kannada

*

57009

x-iscii-ma

ISCII Malayalam

*

57010

x-iscii-gu

ISCII Gujarati

*

57011

x-iscii-pa

ISCII Punjabi

*

65000

utf-7

Unicode (UTF-7)

*

65001

utf-8

Unicode (UTF-8)

*

If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, your application should use the or the provided by the method or the method, respectively, of a derived class.

The UTF-16 and the UTF-32 encoders can use the big endian byte order (most significant byte first) or the little endian byte order (least significant byte first). For example, the Latin Capital Letter A (U+0041) is serialized as follows (in hexadecimal):

UTF-16 big endian byte order: 00 41

UTF-16 little endian byte order: 41 00

UTF-32 big endian byte order: 00 00 00 41

UTF-32 little endian byte order: 41 00 00 00

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.

The method retrieves an array of bytes that includes the byte order mark (BOM). If this byte array is prefixed to an encoded stream, it helps the decoder to identify the encoding format used.

For more information on byte order and the byte order mark, see The Unicode Standard at the Unicode home page.

Note that the encoding classes allow errors to:

Silently change to a "?" character.

Use a "best fit" character.

Change to an application-specific behavior through use of the and classes with the U+FFFD Unicode replacement character.

Your applications are recommended to throw exceptions on all data stream errors. An application either uses a "throwonerror" flag when applicable or uses the and classes. Best fit fallback is often not recommended because it can cause data loss or confusion and is slower than simple character replacements. For ANSI encodings, the best fit behavior is the default.

Represents a character encoding.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  Derived classes override this constructor.

  Initializes a new instance of the class.

  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  Derived classes override this constructor.

  Initializes a new instance of the class that corresponds to the specified code page.

  The code page identifier of the preferred encoding.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding To be added.

  ASCII characters are limited to the lowest 128 Unicode characters, from U+0000 to U+007F.

  When selecting the ASCII encoding for your applications, consider the following:

  The ASCII encoding is usually appropriate for protocols that require ASCII.

  If your application requires 8-bit encoding (which is sometimes incorrectly referred to as "ASCII"), the UTF-8 encoding is recommended over the ASCII encoding. For the characters 0-7F, the results are identical, but use of UTF-8 avoids data loss by allowing representation of all Unicode characters that are representable. Note that the ASCII encoding has an 8th bit ambiguity that can allow malicious use, but the UTF-8 encoding removes ambiguity about the 8th bit.

  Prior to the .NET Framework version 2.0, the .NET Framework allowed spoofing by ignoring the 8th bit. Beginning with the .NET Framework 2.0, non-ASCII code points fall back during decoding.

  The object that is returned by this property might not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with a question mark ("?") character. Instead, you can call the method to instantiate an object whose fallback is either an or a , as the following example illustrates.

  code reference: System.Text.Encoding.ASCII#1

  Gets an encoding for the ASCII (7-bit) character set.

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding

  A for the Unicode format in big-endian byte order.

  The object that is returned by this property may not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with a question mark ("?") character. Instead, you can call the constructor to instantiate a big endian object whose fallback is either an or a , as the following example illustrates.

  code reference: System.Text.Encoding.BigEndianUnicode#2

  The returned object has , , and properties, which yield the name "unicodeFFFE". Although the UTF-16 big endian byte order mark is hexadecimal FEFF, the name "unicodeFFFE" was chosen because the byte order mark appears as hexadecimal FFFE on little endian Windows computers.

  Gets an encoding for the UTF-16 format that uses the big endian byte order.

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  If your application needs an encoding for a body name, it should call with the property. Often the method retrieves a different encoding from the test encoding furnished in the call. Generally only e-mail applications need to retrieve such an encoding; most other applications that need to describe an encoding should use its .

  In some cases, the value of the property corresponds to the international standard that defines that encoding. This does not imply that the actual implementation complies in full with that standard.

  When overridden in a derived class, gets a name for the current encoding that can be used with mail agent body tags.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Object

  The clone is writable even if the original object is read-only. Therefore, the properties of the clone can be modified.

  A shallow copy of an object is a copy of the object only. If the object contains references to other objects, the shallow copy does not create copies of the referred objects. It refers to the original objects instead. In contrast, a deep copy of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object.

  When overridden in a derived class, creates a shallow copy of the current object.

  A copy of the current object.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added.

  When overridden in a derived class, gets the code page identifier of the current .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` `` `` To be added. , or is .

  Converts an entire byte array from one encoding to another.

  An array of type containing the results of converting from to .

  The encoding format of . The target encoding format. The bytes to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` `` `` `` `` To be added.

  , , or is .

  and do not denote a valid range in .

  Converts a range of bytes in a byte array from one encoding to another.

  An array of type containing the result of converting a range of bytes in from to .

  The encoding of the source array, . The encoding of the output array. The array of bytes to convert. The index of the first element of to convert. The number of bytes to convert. 0
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Text.DecoderFallback To be added.

  The object represents an error handler that is invoked when an encoded byte sequence cannot be decoded into a character. Any one of the following handler types is supported:

  A best-fit fallback handler, which replaces bytes that cannot be decoded with some suitable replacement character.

  A replacement fallback handler, which replaces bytes that cannot be decoded with some arbitrary replacement character. The .NET Framework includes one replacement fallback handler, , which by default replaces bytes that cannot be decoded with a question mark ("?") character.

  An exception fallback handler, which throws an exception when bytes cannot be decoded. The .NET Framework includes one exception fallback handler, , which throws a when bytes cannot be decoded.

  Gets or sets the object for the current object.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding

  A for the ANSI code page of the current system.

  Different computers can use different encodings as the default, and the default encoding can even change on a single computer. Therefore, data streamed from one computer to another or even retrieved at different times on the same computer might be translated incorrectly. In addition, the encoding returned by the property uses best-fit fallback to map unsupported characters to characters supported by the code page. For these two reasons, using the default encoding is generally not recommended. To ensure that encoded bytes are decoded properly, your application should use a Unicode encoding, such as or , with a preamble. Another option is to use a higher-level protocol to ensure that the same format is used for encoding and decoding.

  The system ANSI code page defined by covers the ASCII set of characters, but the encoding is different from the encoding for ASCII. Because all encodings lose data, your application might use instead. UTF-8 is often identical in the U+00 to U+7F range, but can encode other characters without loss.

  Gets an encoding for the operating system's current ANSI code page.

  0
- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Text.EncoderFallback To be added.

  The object represents an error handler that is invoked when a character cannot be converted into an encoded byte sequence. Any one of the following handler types is supported:

  A best-fit fallback handler, which replaces characters that cannot be encoded with some suitable replacement character.

  A replacement fallback handler, which replaces characters that cannot be encoded with some arbitrary replacement character. The .NET Framework includes one replacement fallback handler, , which by default replaces characters that cannot be encoded with a question mark ("?") character.

  An exception fallback handler, which throws an exception when characters cannot be encoded. The .NET Framework includes one exception fallback handler, , which throws an when characters cannot be decoded.

  Gets or sets the object for the current object.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  The property is intended for display. To find a name that can be passed to the method, use the property.

  When overridden in a derived class, gets the human-readable description of the current encoding.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Two instances of are considered equal if they correspond to the same code page and their EncoderFallback and DecoderFallback objects are equal. In particular, derived code pages all have a code page of 0 and their fallbacks are normally null (Nothing in Visual Basic .NET). Thus they are all considered equal to one another. One consequence is that when is used to populate a hash table, all derived encodings compare equal and fall into the same hash table slot.

  Determines whether the specified is equal to the current instance.

  true if is an instance of and is equal to the current instance; otherwise, false.

  The to compare with the current instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is .

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used.

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of bytes produced by encoding all the characters in the specified character array.

  The number of bytes produced by encoding all the characters in the specified character array.

  The character array containing the characters to encode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is .

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used.

  If the application handles string inputs, the string version of is recommended.

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string.

  The number of bytes produced by encoding the specified characters.

  The string containing the set of characters to encode. 0
- Method
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` ``

  To calculate the exact array size that requires to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used.

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer.

  The number of bytes produced by encoding the specified characters.

  A pointer to the first character to encode. The number of characters to encode.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is .

  The number of bytes required to encode the specified elements in is greater than .

  -or-

  or is less than zero.

  -or-

  and do not specify a valid range in (i.e. ( + ) > .Length).

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used.

  If the application handles string inputs, the string version of is recommended.

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array.

  The number of bytes produced by encoding the specified characters.

  The character array containing the set of characters to encode. The index of the first character to encode. The number of characters to encode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` is .

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes.

  A byte array containing the results of encoding the specified set of characters.

  The character array containing the characters to encode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` is .

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.

  A byte array containing the results of encoding the specified set of characters.

  The string containing the characters to encode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` `` `` is . and do not denote a valid range in .

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes a set of characters from the specified character array into a sequence of bytes.

  A byte array containing the results of encoding the specified set of characters.

  The character array containing the set of characters to encode. The index of the first character to encode. The number of characters to encode. 0
- Method
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` `` ``

  To calculate the exact array size that requires to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the object provided by the or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer.

  The actual number of bytes written at the location indicated by the parameter.

  A pointer to the first character to encode. The number of characters to encode. A pointer to the location at which to start writing the resulting sequence of bytes. The maximum number of bytes to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  does not contain sufficient space to store the encoded characters.

  is .

  -or-

  is .

  < 0.

  -or-

  < 0.

  -or-

  < 0.

  -or-

  (.Length - ) < .

  -or-

  > .Length.

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array.

  The actual number of bytes written into .

  The character array containing the set of characters to encode. The index of the first character to encode. The number of characters to encode. The byte array to contain the resulting sequence of bytes. The index at which to start writing the resulting sequence of bytes. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  does not contain sufficient space to store the encoded characters.

  is .

  -or-

  is .

  < 0.

  -or-

  < 0.

  -or-

  < 0.

  -or-

  (.Length - ) < .

  -or-

  >= .Length.

  The string containing the set of characters to encode. The index of the first character to encode. The byte array to contain the resulting sequence of bytes. The index at which to start writing the resulting sequence of bytes.

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding. The method expects discrete conversions, in contrast to the method, which handles multiple conversions on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to encode many input characters to a code page and process the characters using multiple calls. In this case, your application probably needs to maintain state between calls, taking into account the state that is persisted by the object being used. (For example, a character sequence that includes surrogate pairs might end with a high surrogate. The will remember that high surrogate so that it can be combined with a low surrogate at the beginning of a following call. won't be able to maintain the state, so the character will be sent to the .)

  If the application handles string inputs, it is recommended to use the string version of .

  The Unicode character buffer version of allows some fast techniques, particularly with multiple calls using the object or inserting into existing buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports byte arrays is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible, and does throw an exception if the output buffer is too small. For continuous encoding of a stream, this method is often the best choice.

  When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.

  The actual number of bytes written into .

  The string containing the set of characters to encode. The index of the first character to encode. The number of characters to encode. The byte array to contain the resulting sequence of bytes. The index at which to start writing the resulting sequence of bytes. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is .

  To calculate the exact array size required by to store the resulting characters, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls.

  If the application handles string outputs, it is recommended to use the method. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array.

  The number of characters produced by decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. 0
- Method
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` ``

  To calculate the exact array size that requires to store the resulting characters, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls.

  If the application handles string outputs, it is recommended to use the method. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer.

  The number of characters produced by decoding the specified sequence of bytes.

  A pointer to the first byte to decode. The number of bytes to decode.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is . and do not specify a valid range in (i.e. ( + ) > .Length).

  To calculate the exact array size required by to store the resulting characters, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls.

  If the application handles string outputs, it is recommended to use the method. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.

  The number of characters produced by decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. The index of the first byte to decode. The number of bytes to decode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char[] `` is .

  gets characters from an input byte sequence. is different than because expects discrete conversions, while is designed for multiple passes on a single input stream.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  Note This method is intended to operate on Unicode characters, not on arbitrary binary data, such as byte arrays. If your application needs to encode arbitrary binary data into text, it should use a protocol such as uuencode, which is implemented by methods such as .

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls, because byte sequences can be interrupted when processed in batches. (For example, part of an ISO-2022 shift sequence may end one call and continue at the beginning of the next call. will call the fallback for those incomplete sequences, but will remember those sequences for the next call.)

  If the application handles string outputs, it is recommended to use the method. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters.

  A character array containing the results of decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char[] `` `` `` is . and do not denote a valid range in the byte array.

  gets characters from an input byte sequence. is different than because expects discrete conversions, while is designed for multiple passes on a single input stream.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  Note This method is intended to operate on Unicode characters, not on arbitrary binary data, such as byte arrays. If your application needs to encode arbitrary binary data into text, it should use a protocol such as uuencode, which is implemented by methods such as .

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls, because byte sequences can be interrupted when processed in batches. (For example, part of an ISO-2022 shift sequence may end one call and continue at the beginning of the next call. will call the fallback for those incomplete sequences, but will remember those sequences for the next call.)

  If the application handles string outputs, it is recommended to use the method. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters.

  A character array containing the results of decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. The index of the first byte to decode. The number of bytes to decode. 0
- Method
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` `` ``

  To calculate the exact array size that requires to store the resulting characters, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  gets characters from an input byte sequence. is different than because expects discrete conversions, while is designed for multiple passes on a single input stream.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the object provided by the or the method, respectively, of a derived class.

  Note This method is intended to operate on Unicode characters, not on arbitrary binary data, such as byte arrays. If your application needs to encode arbitrary binary data into text, it should use a protocol such as uuencode, which is implemented by methods such as .

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls, because byte sequences can be interrupted when processed in batches. (For example, part of an ISO-2022 shift sequence may end one call and continue at the beginning of the next call. will call the fallback for those incomplete sequences, but will remember those sequences for the next call.)

  If the application handles string outputs, the method is recommended. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer.

  The actual number of characters written at the location indicated by the parameter.

  A pointer to the first byte to decode. The number of bytes to decode. A pointer to the location at which to start writing the resulting set of characters. The maximum number of characters to write.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  does not contain sufficient space to store the decoded characters.

  is .

  -or-

  is .

  < 0.

  -or-

  < 0.

  -or-

  < 0.

  -or-

  and do not specify a valid range in (i.e. (+ ) > .Length).

  -or-

  > .Length.

  To calculate the exact array size required by to store the resulting characters, the application should use . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  gets characters from an input byte sequence. is different than because expects discrete conversions, while is designed for multiple passes on a single input stream.

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  Note This method is intended to operate on Unicode characters, not on arbitrary binary data, such as byte arrays. If your application needs to encode arbitrary binary data into text, it should use a protocol such as uuencode, which is implemented by methods such as .

  The method determines how many characters result in decoding a sequence of bytes, and the method performs the actual decoding. The method expects discrete conversions, in contrast to the method, which handles multiple passes on a single input stream.

  Several versions of and are supported. The following are some programming considerations for use of these methods:

  The application might need to decode multiple input bytes from a code page and process the bytes using multiple calls. In this case, your application probably needs to maintain state between calls, because byte sequences can be interrupted when processed in batches. (For example, part of an ISO-2022 shift sequence may end one call and continue at the beginning of the next call. will call the fallback for those incomplete sequences, but will remember those sequences for the next call.)

  If the application handles string outputs, the method is recommended. Since this method must check string length and allocate a buffer, it is slightly slower, but the resulting type is to be preferred.

  The byte version of allows some fast techniques, particularly with multiple calls to large buffers. Bear in mind, however, that this method version is sometimes unsafe, since pointers are required.

  If your application must convert a large amount of data, it should reuse the output buffer. In this case, the version that supports output character buffers is the best choice.

  Consider using the method instead of . The conversion method converts as much data as possible and throws an exception if the output buffer is too small. For continuous decoding of a stream, this method is often the best choice.

  When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array.

  The actual number of characters written into .

  The byte array containing the sequence of bytes to decode. The index of the first byte to decode. The number of bytes to decode. The character array to contain the resulting set of characters. The index at which to start writing the resulting set of characters. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Decoder

  The method converts sequential blocks of bytes into sequential blocks of characters, in a manner similar to the method of this class. However, a maintains state information between calls so it correctly decodes byte sequences that span blocks. The also preserves trailing bytes at the end of data blocks and uses the trailing bytes in the next decoding operation. Therefore, and are useful for network transmission and file operations, because those operations often deal with blocks of data instead of a complete data stream.

  When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.

  A that converts an encoded sequence of bytes into a sequence of characters.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoder

  The method converts sequential blocks of characters into sequential blocks of bytes, in a manner similar to the method of this class. However, a maintains state information between calls so it correctly encodes character sequences that span blocks. The also preserves trailing characters at the end of data blocks and uses the trailing characters in the next encoding operation. For example, a data block might end with an unmatched high surrogate, and the matching low surrogate might be in the next data block. Therefore, and are useful for network transmission and file operations, because those operations often deal with blocks of data instead of a complete data stream.

  When overridden in a derived class, obtains an encoder that converts a sequence of Unicode characters into an encoded sequence of bytes.

  A that converts a sequence of Unicode characters into an encoded sequence of bytes.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding ``

  The fallback handler depends on the encoding type of . If is a code page or double-byte character set (DBCS) encoding, a best-fit fallback handler is used. Otherwise, a replacement fallback handler is used. These fallback handlers may not be appropriate for your application. To specify the fallback handler used by the encoding specified by , you can call the overload.

  The method relies on the underlying platform to support most code pages. However, the .NET Framework natively supports some encodings. For a list of code pages, see the class topic. Alternatively, you can call the method to get an array of objects that contains information about all encodings.

  To get the encoding associated with the default ANSI code page in the operating system's regional and language settings, the application can either use a setting of 0 for the parameter or the property. To determine the default code pages used on the system, use the Windows GetSystemDefaultLangID function. To determine the current ANSI code page, use the Windows GetACP function.

  Some unsupported code pages cause the exception to be thrown, whereas others cause . Therefore, your code must catch all exceptions indicated in the Exceptions section.

  The ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For this reason, encoding and decoding data using the default code page returned by Encoding.GetEncoding(0) is not recommended. For the most consistent results, applications should use Unicode, such as UTF-8 (code page 65001) or UTF-16, instead of a specific code page.

  returns a cached instance with default settings. The application should use the constructors of derived classes to get an instance with different settings. For example, the class provides a constructor that lets you enable error detection.

  Returns the encoding associated with the specified code page identifier.

  The encoding that is associated with the specified code page.

  The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the class topic.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding ``

  The fallback handler depends on the encoding type of . If is a code page or double-byte character set (DBCS) encoding, a best-fit fallback handler is used. Otherwise, a replacement fallback handler is used. These fallback handlers may not be appropriate for your application. To specify the fallback handler used by the encoding specified by , you can call the overload.

  The GetEncoding method relies on the underlying platform to support most code pages. However, the .NET Framework natively supports some encodings.

  The ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For the most consistent results, applications should use Unicode, such as UTF-8 (code page 65001) or UTF-16, instead of a specific code page.

  For a list of code pages, see the class topic. The application uses the method to get a list of all encodings.

  returns a cached instance with default settings. The application should use the constructors of derived classes to get an instance with different settings. For example, the class provides a constructor that lets you enable error detection.

  Returns the encoding associated with the specified code page name.

  The encoding associated with the specified code page.

  The code page name of the preferred encoding. Any value returned by the property is valid. Possible values are listed in the Name column of the table that appears in the class topic.
- Method
  2.0.0.0
  4.0.0.0
  System.Text.Encoding `` `` ``

  Some unsupported code pages cause the exception to be thrown, whereas others cause . Therefore, your code must catch all exceptions indicated in the Exceptions section.

  The method relies on the underlying platform to support most code pages. However, the .NET Framework natively supports some encodings.

  The ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For this reason, encoding and decoding data using the default code page returned by Encoding.GetEncoding(0) is not recommended. For the most consistent results, applications should use Unicode, such as UTF-8 (code page 65001) or UTF-16, instead of a specific code page.

  For a list of code pages, see the class topic. The application uses the method to get a list of all encodings.

  To get the encoding associated with the default ANSI code page in the operating system's regional and language settings, the application can either use a setting of 0 for the parameter or use the property. To determine the default code pages used on the system, use the Windows GetSystemDefaultLangID function. To determine the current ANSI code page, use the Windows GetACP function.

  returns a cached instance with default settings. The application should use the constructors of derived classes to get an instance with different settings. For example, the class provides a constructor that lets you enable error detection.

  Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.

  The encoding that is associated with the specified code page.

  The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the class topic. An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding.
- Method
  2.0.0.0
  4.0.0.0
  System.Text.Encoding `` `` ``

  The GetEncoding method relies on the underlying platform to support most code pages. However, the .NET Framework natively supports some encodings.

  The ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For the most consistent results, applications should use Unicode, such as UTF-8 (code page 65001) or UTF-16, instead of a specific code page.

  For a list of code pages, see the class topic. The application uses the method to get a list of all encodings.

  returns a cached instance with default settings. The application should use the constructors of derived classes to get an instance with different settings. For example, the class provides a constructor that lets you enable error detection.

  Returns the encoding associated with the specified code page name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded.

  The encoding that is associated with the specified code page.

  The code page name of the preferred encoding. Any value returned by the property is valid. Possible values are listed in the Name column of the table that appears in the class topic. An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding.
- Method
  2.0.0.0
  4.0.0.0
  System.Text.EncodingInfo[]

  This method returns a list of supported encodings, uniquely distinguished by code page. For a table that lists the supported encodings, see the class topic.

  Encodings 50220 and 50222 are both associated with the name "iso-2022-jp", but they are not identical. Encoding 50220 converts half-width Katakana characters to full-width Katakana characters, whereas encoding 50222 uses a shift-in/shift-out sequence to encode half-width Katakana characters. The display name for encoding 50222 is "Japanese (JIS-Allow 1 byte Kana - SO/SI)" to distinguish it from encoding 50220, which has the display name "Japanese (JIS)".

  If your application requests the encoding name "iso-2022-jp", the .NET Framework returns encoding 50220. However, the encoding that is appropriate for your application will depend on the preferred treatment of the half-width Katakana characters.

  To get a specific encoding, your application should use the method.

  is sometimes used to present the user with a list of encodings in a File Save as dialog box. However, many non-Unicode encodings are either incomplete and translate many characters to "?", or have subtly different behavior on different platforms. Consider using UTF-8 or UTF-16 as the default.

  Returns an array that contains all encodings.

  An array that contains all encodings.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  The algorithm used to generate the hash code is unspecified.

  This method overrides .

  Returns the hash code for the current instance.

  The hash code for the current instance.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  The parameter actually specifies the number of objects that represent the Unicode characters to encode, because the .NET Framework internally uses UTF-16 to represent Unicode characters. Consequently, most Unicode characters can be represented by one object, but a Unicode character represented by a surrogate pair, for example, requires two objects.

  To calculate the exact array size required by to store the resulting bytes, the application should use . To calculate the maximum array size, it should use . The method generally allows allocation of less memory, while the method generally executes faster.

  retrieves a worst-case number, including the worst case for the currently selected . If a fallback is chosen with a potentially large string, retrieves large values, particularly in cases where the worst case for the encoding involves switching modes for every character. For example, this can happen for ISO-2022-JP. For more information, see the blog entry "What's with Encoding.GetMaxByteCount() and Encoding.GetMaxCharCount()?" (http://blogs.msdn.com/shawnste/archive/2005/03/02/383903.aspx).

  In most cases, this method retrieves reasonable values for small strings. For large strings, you might have to choose between using very large buffers and catching errors in the rare case when a more reasonable buffer is too small. You might also want to consider a different approach using or .

  When using , your application should allocate the output buffer based on the maximum size of the input buffer. If the output buffer is constrained in size, the application might use the Convert method.

  Note that considers potential leftover surrogates from a previous decoder operation. Because of the decoder, passing a value of 1 to the method retrieves 2 for a single-byte encoding, such as ASCII. Your application should use the property if this information is necessary.

  GetMaxByteCount(N) is not necessarily the same value as N* GetMaxByteCount(1).

  When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.

  The maximum number of bytes produced by encoding the specified number of characters.

  The number of characters to encode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  To calculate the exact array size required by to store the resulting characters, the application should use . To calculate the maximum array size, it should use . The method generally allows allocation of less memory, while the method generally executes faster.

  retrieves a worst-case number, including the worst case for the currently selected . If a fallback is chosen with a potentially large string, retrieves large values.

  In most cases, this method retrieves reasonable numbers for small strings. For large strings, you might have to choose between using very large buffers and catching errors in the rare case that a more reasonable buffer is too small. You might also want to consider a different approach using or .

  has no relation to . If your application needs a similar function to use with , it should use .

  When using , your application should allocate the output buffer based on the maximum size of the input buffer. If the output buffer is constrained in size, the application might use the Convert method.

  Note that considers the worst case for leftover bytes from a previous encoder operation. For most code pages, passing a value of 0 to this method retrieves values greater than or equal to 1.

  GetMaxCharCount(N) is not necessarily the same value as N* GetMaxCharCount(1).

  When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.

  The maximum number of characters produced by decoding the specified number of bytes.

  The number of bytes to decode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[]

  Optionally, the object provides a preamble that is an array of bytes that can be prefixed to the sequence of bytes resulting from the encoding process. If the preamble contains a byte order mark (in Unicode, code point U+FEFF), it helps the decoder determine the byte order and the transformation format or UTF.

  The Unicode byte order mark (BOM) is serialized as follows (in hexadecimal):

  UTF-8: EF BB BF

  UTF-16 big endian byte order: FE FF

  UTF-16 little endian byte order: FF FE

  UTF-32 big endian byte order: 00 00 FE FF

  UTF-32 little endian byte order: FF FE 00 00

  Your applications are recommended to use the BOM, because it provides nearly certain identification of an encoding for files that otherwise have lost reference to the Encoding object, for example, untagged or improperly tagged web data or random text files stored when a business did not have international concerns or other data. Often user problems might be avoided if data is consistently and properly tagged, preferably in UTF-8 or UTF-16.

  For standards that provide an encoding type, a BOM is somewhat redundant. However, it can be used to help a server send the correct encoding header. Alternatively, it can be used as a fallback in case the encoding is otherwise lost.

  There are some disadvantages to using a BOM. For example, knowing how to limit the database fields that use a BOM can be difficult. Concatenation of files can be a problem also, for example, when files are merged in such a way that an unnecessary character can end up in the middle of data. In spite of the few disadvantages, however, the use of a BOM is highly recommended.

  For more information on byte order and the byte order mark, see The Unicode Standard at the Unicode home page.

  To ensure that the encoded bytes are decoded properly, your application should prefix encoded bytes with a preamble. However, most encodings do not provide a preamble. To ensure that the encoded bytes are decoded properly, the application should use a Unicode encoding, that is, , , or , with a preamble.

  When overridden in a derived class, returns a sequence of bytes that specifies the encoding used.

  A byte array containing a sequence of bytes that specifies the encoding used.

  -or-

  A byte array of length zero, if a preamble is not required.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is .

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, you should use the object returned by the method of a derived class.

  See the Remarks section of the reference topic for a discussion of decoding techniques and considerations.

  Note that the precise behavior of the method for a particular implementation depends on the fallback strategy defined for that object. For more information, see the "Choosing a Fallback Strategy" section of the Character Encoding in the .NET Framework topic.

  When overridden in a derived class, decodes all the bytes in the specified byte array into a string.

  A string that contains the results of decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `` is . and do not denote a valid range in .

  If the data to be converted is available only in sequential blocks (such as data read from a stream) or if the amount of data is so large that it needs to be divided into smaller blocks, the application should use the or the provided by the method or the method, respectively, of a derived class.

  See the Remarks section of the reference topic for a discussion of decoding techniques and considerations.

  When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string.

  A string that contains the results of decoding the specified sequence of bytes.

  The byte array containing the sequence of bytes to decode. The index of the first byte to decode. The number of bytes to decode. 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  If your application needs an encoding for a header name, it should call with the property. Often the method retrieves a different encoding from the test encoding furnished in the call. Generally only e-mail applications need to retrieve such an encoding.

  In some cases, the value of the property corresponds to the international standard that defines that encoding. This does not imply that the actual implementation complies in full with that standard.

  Note that returns the name to use to describe an encoding. The property defines a different encoding that might work better for an e-mail application, for example. However, use of the property to define the encoding is not recommended.

  When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean

  The default normalization form is , which uses full canonical decomposition, followed by the replacement of sequences with their primary composites, if possible.

  Gets a value indicating whether the current encoding is always normalized, using the default normalization form.

  true if the current is always normalized; otherwise, false. The default is false.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean ``

  The default normalization form is , which uses full canonical decomposition, followed by the replacement of sequences with their primary composites, if possible.

  When overridden in a derived class, gets a value indicating whether the current encoding is always normalized, using the specified normalization form.

  true if the current object is always normalized using the specified value; otherwise, false. The default is false.

  One of the values.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for displaying content.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for saving content.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for saving content.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean To be added. To be added.

  When overridden in a derived class, gets a value indicating whether the current encoding is read-only.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean To be added.

  For a single-byte encoding, for example, , this property retrieves true.

  You should be careful in what your application does with the value for . An assumption of how an Encoding will proceed may still be wrong. For example, Windows-1252 has a value of true for , but Encoding.GetMaxByteCount(1) returns 2. This is because the method considers potential leftover surrogates from a previous decoder operation.

  When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding

  A for the Unicode format in little-endian byte order.

  For information about the encodings supported by the .NET Framework and a discussion of which Unicode encoding to use, see Understanding Encodings.

  The object that is returned by this property may not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with a question mark ("?") character. Instead, you can call the constructor to instantiate a little endian object whose fallback is either an or a , as the following example illustrates.

  code reference: System.Text.Encoding.Unicode#2

  Gets an encoding for the UTF-16 format using the little endian byte order.

  0
- Property
  2.0.0.0
  4.0.0.0
  System.Text.Encoding To be added.

  The object that is returned by this property may not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with the Unicode REPLACEMENT CHARACTER (U+FFFE). Instead, you can call the constructor to instantiate a object whose fallback is either an or a , as the following example illustrates.

  code reference: System.Text.Encoding.UTF32#1

  For a discussion of little endian byte order, see the class topic.

  For information about the encodings supported by the .NET Framework and a discussion of which Unicode encoding to use, see Understanding Encodings.

  Gets an encoding for the UTF-32 format using the little endian byte order.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding To be added.

  UTF-7 encoding is used primarily in environments that historically have been restricted to 7 bits, such as NNTP and some email applications. Because of issues with robustness and security, you should not use UTF7 encoding in 8-bit environments where UTF-8 encoding can be used instead.

  Gets an encoding for the UTF-7 format.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoding

  A for the UTF-8 format.

  This property returns a object that encodes Unicode (UTF-16-encoded) characters into a sequence of one to four bytes per character, and that decodes a UTF-8-encoded byte array to Unicode (UTF-16-encoded) characters. For information about the character encodings supported by the .NET Framework and a discussion of which Unicode encoding to use, see Understanding Encodings.

  The object that is returned by this property may not have the appropriate behavior for your application. It uses replacement fallback to replace each string that it cannot encode and each byte that it cannot decode with a question mark ("?") character. Instead, you can call the constructor to instantiate a object whose fallback is either an or a , as the following example illustrates.

  code reference: System.Text.Encoding.UTF8#1

  Gets an encoding for the UTF-8 format.

  0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String The name of the encoding in web form.

  The property is the same as the property.

  Note that returns an IANA-registered name for the encoding. When its value is the name of a standard, the actual implementation of the encoding may not conform in full to that standard. The property defines a different encoding that might work better for e-mail headers. However, most applications should use instead.

  For more information on the IANA, go to www.iana.org.

  The is the same as the returned by . Some of the web names are duplicates; see the remarks for for more information.

  When overridden in a derived class, gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  This property is provided for compatibility with the Windows MultiLanguage (MLang) APIs, for example, in determining font families. For globalization, using one of the Unicode encodings is recommended instead. It is also recommended to use instead of to identify the code page.

  When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding.

0