c# and Encoding.ASCII.GetString

后端 未结 5 1899
南旧
南旧 2020-12-06 03:51
byte[] header = new byte[]{255, 216}; 

string ascii =  Encoding.ASCII.GetString(header);

I expect ASCII to be equal to be FFD8 (JPEG SOI marker)<

5条回答
  •  青春惊慌失措
    2020-12-06 04:32

    I once wrote a custom encoder/decoder that encoded bytes 0-255 to unicode characters 0-255 and back again.

    It was only really useful for using string functions on something that isn't actually a string.

提交回复
热议问题