I have an unsigned char*
filled with characters not just ASCII for example: `
¤ÝkGòd–ùë$}ôKÿUãšj@Äö5ÕnE„_–ÄŠç•§-ö—RS^HÌVÄ¥U` .
If I reinterpret_cast
, I'll lose characters if I'm not mistaken because they're not all ASCII. I've searched everywhere but all the solutions require some sort of casting or conversion that will alter the data. Here's what I have, which doesn't work.
unsigned char* cipherText = cipher->encrypt(stringTest);
string cipherString(reinterpret_cast<char*>(cipherText)); //<-- At this point data changes in debugger
outputfile.open(outfile);
outputfile.close();