Copied from MSDN:
ms-help://MS.MSDNQTR.2005JUL.1033/cpref/html/frlrfSystemTextEncodingClassGetBytesTopic.htm
ms-help://MS.MSDNQTR.2005JUL.1033/cpref/html/frlrfsystemtextencodingclassgetbytestopic3.htm
Encodes a range of characters from a character array into a byte array.
Supported by the .NET Compact Framework.
[Visual Basic] Overloads Public Overridable Function GetBytes(Char(),
Integer, Integer) As Byte()
[C#] public virtual byte[] GetBytes(char[], int, int);
[C++] public: virtual unsigned char GetBytes(__wchar_t __gc[], int, int)
__gc[];
[JScript] public function GetBytes(Char[], int, int) : Byte[];
-- End of Copy --
If there is error, I suspect you really means
System.Text.Encoding.UTF8.GetBytes().
Spectre said:
I don't beleive you can pass a char[] to that method.
Lau Lei Cheong said:
Use System.Text.Encoding.Unicode.getBytes().
John A Grandy said:
How to copy an char[] to a byte[] , where the char[] holds unicode
characters ?