How can I convert extended ascii to a System.String?

后端 未结 4 1559
無奈伤痛
無奈伤痛 2020-12-03 07:04

For example: \"½\" or ASCII DEC 189. When I read the bytes from a text file the byte[] contains the valid value, in this case 189.

Converting to Unicode results in

4条回答
  •  北海茫月
    2020-12-03 07:54

    It depends on exactly what the encoding is.

    There's no such thing as "ASCII 189" - ASCII only goes up to 127. There are many encodings which a 8-bit encodings using ASCII for the first 128 values.

    You may want Encoding.Default (which is the default encoding for your particular system), but it's hard to know for sure. Where did your data come from?

提交回复
热议问题