Create an Encoding
object for the windows-1251 encoding, and decode the byte array:
byte[] data = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x53, 0x68, 0x61, 0x72, 0x6f, 0x6b, 0x2e
};
string text = Encoding.GetEncoding(1251).GetString(data);
The second set of data doesn't decode into russian characters, but into this (including a space at the start and a line break (CR+LF) ending each of the three lines):
=CF=F0=E8=E2=E5=F2
.
To get the string that you want, you would first have to decode the data into a string, then extract the hexadecimal codes from the string, convert those into bytes, and decode those bytes:
Encoding win = Encoding.GetEncoding(1251);
string text = win.GetString(
Regex.Matches(win.GetString(data), "=(..)")
.OfType<Match>()
.Select(m => Convert.ToByte(m.Groups[1].Value, 16))
.ToArray()
);