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:
Any byte greater than hexadecimal 0x7F is decoded as the Unicode question mark ("?")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With