String^ asciiString = gcnew String( asciiChars ) Convert the new Byte into a char and then into a string.Īrray^asciiChars = gcnew array(ascii->GetCharCount( asciiBytes, 0, asciiBytes->Length )) Īscii->GetChars( asciiBytes, 0, asciiBytes->Length, asciiChars, 0 ) Perform the conversion from one encoding to the other.Īrray^asciiBytes = Encoding::Convert( unicode, ascii, unicodeBytes ) String^ unicodeString = "This string contains the unicode character Pi (Π)" Īrray^unicodeBytes = unicode->GetBytes( unicodeString ) NET Char and String types are themselves Unicode, so the GetChars call decodes the data back to Unicode. The byte array is the only type in this example that contains the encoded data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |