EncodingStatic: Convert

Convert

Converts a set of bytes from one encoding to another encoding.



 Public Function Convert(
	  ByVal SrcEncoding As Encoding,
	  ByVal DstEncoding As Encoding,
	  ByRef Bytes ( ) As Byte,
	  Optional ByRef Index As Variant,
	  Optional ByRef Count As Variant ) As Byte ( )

Parameters

SrcEncoding
[ByVal] Encoding. The encoding of the source array, Bytes.
DstEncoding
[ByVal] Encoding. The encoding of the output array.
Bytes
[ByRef] Byte. The array of bytes to convert.
Index
[ByRef] Optional. Variant. The index of the first element of Bytes to convert.
Count
[ByRef] Optional. Variant. The number of bytes to convert.

Return Values

Byte() -  An array of bytes containing the result of converting a range of bytes in bytes from SrcEncoding to DstEncoding.

Exceptions

ExceptionCondition
ArgumentNullException SrcEncoding is Nothing.
-or-
DstEncoding is Nothing.
-or-
Bytes is uninitialized.
ArgumentOutOfRangeException Index and Count do not specify a valid range in the byte array.
DecoderFallbackException A fallback occurred
-and-
SrcEncoding.DecoderFallback is set to DecoderExceptionFallback.
EncoderFallbackException A fallback occurred
-and-
DstEncoding.EncoderFallback is set to EncoderExceptionFallback.

See Also

Project CorLib Overview

Class EncodingStatic Overview