Byte to String to byte conversion puzzling error
byte, c#, getstring, string
Solution
0xB0 is not a valid ASCII code. You can read here:
Any byte greater than hexadecimal 0x7F is decoded as the Unicode question mark ("?")
Problem
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`.