How do I convert from 8 bit byte to 7 bit byte (Base 256 to Base 128)

后端 未结 4 1941
难免孤独
难免孤独 2021-01-24 12:39

How do I convert from 8 bit byte to 7 bit byte (Base 256 to Base 128)

I am looking to do something like this:

public string BytesToString(byte[] in)
{

}         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 12:52

    Alternatively, there's the ASCIIEncoding class that converts a UTF-8 String to an array of 8-bits bytes, discarding characters that can't be represented in 7-bits ASCII.

提交回复
热议问题