   [.net] convert string to char array (mc++/cli)
  System::String^ s = "DeviceInfo";array<wchar_t,1>^ unicodeArray = s->ToCharArray();array<unsigned char,1>^ charArray= System::Convert::FromBase64CharArray(unicodeArray ,0 /*offset*/,unicodeArray ->Length);compiles without warnings. No casting required. Length returns 10.Error: Invalid length for a Base-64 char array.im lost, this should work as far as i can see.Anybody any ideas?   
  The problem is that your unicodeArray is not a base 64 char array (uuencoded). A true base 64 char array must be a multiple of 4 bytes long and have base 64 characters in it. A standard System::String doesn't have base 64 characters.I'm not sure I understand what you are trying to do. If all you want to do is convert a System::String to an array of characters (System::Char[]), all you need is the ToCharArray().;  yeah, your right, oops.However i know i can convert to a character array with ToCharArray() but that returns a unicode 16 bit character.There are infact file write methods which take 8 bit byte streams. How do i convert to 8 bit characters?   ;  .Net strings are Unicode capable. To get bytes you need to use a System.Text.Encoding class, e.g. byte[] bytes = Encoding.UTF8.GetBytes(myString).   