Converts a range of bytes in a byte array from one encoding to another.
[Visual Basic] Overloads Public Shared Function Convert( _ ByVal srcEncoding As Encoding, _ ByVal dstEncoding As Encoding, _ ByVal bytes() As Byte, _ ByVal index As Integer, _ ByVal count As Integer _ ) As Byte () [C#] public static byte[] Convert( Encoding srcEncoding, Encoding dstEncoding, byte[] bytes, int index, int count ); [C++] public: static unsigned char* Convert( Encoding* srcEncoding, Encoding* dstEncoding, unsigned char* bytes[], int index, int count ) []; [JScript] public static function Convert( srcEncoding : Encoding, dstEncoding : Encoding, bytes : Byte[], index : int, count : int ) : Byte[];
An array of type Byte containing the result of the conversion.
Exception Type | Condition |
---|---|
ArgumentNullException | srcEncoding, dstEncoding or bytes arguments are a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | index and count do not denote a valid range in the byte array. |
This method converts count bytes at the starting index from srcEncoding to dstEncoding.
Encoding Class | Encoding Members | System.Text Namespace | Encoding.Convert Overload List