byte value can be 0 to 255.
When the byte value > 127, then result of
System.Text.Encoding.ASCII.GetChars()
is always '?' which has value 63
Therefore,
System.Text.Encoding.ASCII.GetBytes()
result always get 63 (wrong value) for those have initial byte value > 127
If you need TABLE ASCII -II then you can do as following
var b = new byte[] { 252, 2, 56, 8, 9 };
//another encoding
var e = Encoding.GetEncoding("437");
//252 inside the mentioned table is ⁿ and now you have it
var g = e.GetString(b);
//now you can get the byte value 252
var f = e.GetBytes(g);
Similar posts you can read