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 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Text.Encoding System.Runtime.InteropServices.ComVisible(true)

Encoding is the process of transforming a set of Unicode characters into a sequence of bytes. Decoding is the process of transforming a sequence of encoded bytes into a set of Unicode characters.

The UTF-7 encoding represents Unicode characters as sequences of 7-bit ASCII characters. This encoding supports certain protocols for which it is required, most often e-mail or newsgroup protocols. Since UTF-7 is not particularly secure or robust, and most modern systems allow 8-bit encodings, UTF-8 should normally be preferred to UTF-7.

does not provide error detection. For security reasons, the application should use , , or and enable error detection.

For more information about the UTFs and other encodings supported by , see Understanding Encodings.

The method determines how many bytes result in encoding a set of Unicode characters, and the method performs the actual encoding.

Likewise, the method determines how many characters result in decoding a sequence of bytes, and the and methods perform the actual decoding.

corresponds to the Windows code page 65000.

The state of a UTF-7 encoded object is not preserved if the object is serialized and deserialized using different .NET Framework versions.

Represents a UTF-7 encoding of Unicode characters.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor creates an instance that does not allow optional characters. Calling the constructor is equivalent to calling the constructor that takes an parameter and specifying false for that parameter.

  If an instance allows optional characters, Unicode code points are encoded with a corresponding optional character instead of a modified base 64 character. The optional characters are exclamation point ("!"), backward slash ("\"), vertical line ("|"), double quote ("""), number sign ("#"), dollar sign ("$"), percent sign ("%"), ampersand ("&"), asterisk ("*"), semicolon (";"), left angle bracket ("<"), right angle bracket (">"), left curly bracket ("{"), right curly bracket ("}"), left square bracket ("["), right square bracket ("]"), equal sign ("="), at sign ("@"), circumflex accent ("^"), underscore ("_"), and grave accent ("`").

  does not provide error detection. For security reasons, your applications are recommended to use , , or and enable error detection.

  Initializes a new instance of the class.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  If an instance allows optional characters, Unicode code points are encoded with a corresponding optional character instead of a modified base 64 character. The optional characters are exclamation point ("!"), backward slash ("\"), vertical line ("|"), double quote ("""), number sign ("#"), dollar sign ("$"), percent sign ("%"), ampersand ("&"), asterisk ("*"), semicolon (";"), left angle bracket ("<"), right angle bracket (">"), left curly bracket ("{"), right curly bracket ("}"), left square bracket ("["), right square bracket ("]"), equal sign ("="), at sign ("@"), circumflex accent ("^"), underscore ("_"), and grave accent ("`").

  does not provide error detection. For security reasons, your applications are recommended to use , , or and enable error detection.

  Initializes a new instance of the class. A parameter specifies whether to allow optional characters.

  true to specify that optional characters are allowed; otherwise, false.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean ``

  Two objects are equal if they both either allow or disallow optional characters, and if their underlying and properties are equal.

  Gets a value indicating whether the specified object is equal to the current object.

  true if is a object and is equal to the current object; otherwise, false.

  An object to compare to the current object.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 ``

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

  Calculates the number of bytes produced by encoding the characters in the specified object.

  The number of bytes produced by encoding the specified characters.

  The object containing the set of characters to encode.
- 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 uses . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  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 `` `` ``

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

  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.
- 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 required by to store the resulting bytes, the application uses . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. Invalid characters are encoded as a modified base 64 character. For security reasons, your applications are recommended to use , , or and enable error detection.

  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 .

  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 `` `` `` `` ``

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

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. Invalid characters are encoded as a modified base 64 character. For security reasons, your applications are recommended to use , , or and enable error detection.

  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.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` `` `` ``

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

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. Invalid characters are encoded as a modified base 64 character. For security reasons, your applications are recommended to use , , or and enable error detection.

  Encodes a set of characters from the specified into the specified byte array.

  The actual number of bytes written into .

  The 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.
- 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 required by to store the resulting characters, 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.

  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 `` `` ``

  To calculate the exact array size required by to store the resulting characters, 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.

  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.
- 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 required by to store the resulting characters, 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.

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. When invalid bytes are encountered, generally emits the invalid bytes. If a byte is larger than hexadecimal 0x7F, the byte value is zero-extended into a Unicode character, the result is stored in the array, and any shift sequence is terminated. For example, if the byte to encode is hexadecimal 0x81, the resulting character is U+0081. For security reasons, your applications are recommended to use , , or and enable error detection.

  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 .

  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 `` `` `` `` ``

  To calculate the exact array size required by to store the resulting characters, 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.

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. When invalid bytes are encountered, generally emits the invalid bytes. If a byte is larger than hexadecimal 0x7F, the byte value is zero-extended into a Unicode character, the result is stored in the array, and any shift sequence is terminated. For example, if the byte to encode is hexadecimal 0x81, the resulting character is U+0081. For security reasons, your applications are recommended to use , , or and enable error detection.

  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.
- 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 can correctly decode 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.

  Obtains a decoder that converts a UTF-7 encoded sequence of bytes into a sequence of Unicode characters.

  A that converts a UTF-7 encoded sequence of bytes into a sequence of Unicode characters.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Text.Encoder

  The method converts sequential blocks of bytes into sequential blocks of characters, in a manner similar to the method. However, a maintains state information between calls so it can correctly decode 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.

  Obtains an encoder that converts a sequence of Unicode characters into a UTF-7 encoded sequence of bytes.

  A that converts a sequence of Unicode characters into a UTF-7 encoded sequence of bytes.

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

  The value returned by the method is not suitable for distinguishing one object from another. If your application needs a unique hash code, it should override the method.

  Returns the hash code for the current object.

  A 32-bit signed integer hash code.

- 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 bytes, the application uses . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

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

  In most cases, this method returns 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 exceeded. You might also want to consider a different approach using or . While UTF-7 is very efficient at encoding ASCII data, one byte per character, it is extremely inefficient for other data. As remarked above, deals with a worst case. If the data to be encoded is largely ASCII, and especially if the ASCII characters cluster together, UTF-7 is significantly more efficient than the number returned by this method suggests.

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

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

  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.
- 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 uses . To calculate the maximum array size, the application should use . The method generally allows allocation of less memory, while the method generally executes faster.

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

  In most cases, this method returns 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 exceeded. 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 .

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

  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.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` `` ``

  Data to be converted, such as data read from a stream, might be available only in sequential blocks. In this case, 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.

  does not provide error detection. When invalid bytes are encountered, generally emits the invalid bytes. If a byte is larger than hexadecimal 0x7F, the byte value is zero-extended into a Unicode character, the result is stored in the array, and any shift sequence is terminated. For example, if the byte to encode is hexadecimal 0x81, the resulting character is U+0081. For security reasons, your applications are recommended to use , , or and enable error detection.

  Decodes a range of bytes from a byte array into a string.

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