J
John A Grandy
How to copy an char[] to a byte[] , where the char[] holds unicode
characters ?
characters ?
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 ?
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 ?
Spectre said:public static byte[] CharToByte(char[] c)
{
byte[] b = new byte[c.Length];
for(int i = 0; i < c.Length; i++)
{
b = (byte) c;
}
return b;
}
Simple as that![]()