Could anyone please help spot the error? Here's the code:
byte[] oriBytes = { 0xB0, 0x2D }; // oriBytes -> 0xB0, 0x2D
string oriInStr = Encoding.ASCII.GetString(oriBytes); // oriInStr -> "?-"
oriBytes = Encoding.ASCII.GetBytes(oriInStr); // oriBytes -> 0x3F, 0x2D
I can't get back the original bytes values of 0xB0
, 0x2D
.
0xB0 is not a valid ASCII code. You can read here: