字节转换为字节转换令人费解的错误

sam*_*yte 4 c# string byte getstring

有谁可以请帮助发现错误?这是代码:

   byte[] oriBytes = { 0xB0, 0x2D };                       // oriBytes -> 0xB0, 0x2D
   string oriInStr = Encoding.ASCII.GetString(oriBytes);   // oriInStr ->   "?-"
   oriBytes = Encoding.ASCII.GetBytes(oriInStr);           // oriBytes -> 0x3F, 0x2D
Run Code Online (Sandbox Code Playgroud)

我无法取回原来的字节值0xB0,0x2D.

Fra*_*tyx 8

0xB0不是有效的ASCII码.你可以在这里阅读:

任何大于十六进制0x7F的字节都被解码为Unicode问号("?")