title: Decoding a string c#
body: <p>I created TCP server that is distributing client's messages and run on a problem. When I'm sending Cyrillic messages through stream they're not decoding properly. Anyone knows how can I repair that? </p>
  
  <p>Here's the code for sending the message: </p>
  
  <pre><code>var message = Console.ReadLine().ToCharArray().Select(x =&gt; (byte)x).ToArray();
  stream.Write(message);`
  </code></pre>
  
  <p>Here's the code for receiving:</p>
  
  <pre><code>var numberOfBytes = stream.Read(buffer,0,1024);
  Console.WriteLine($"{numberOfBytes} bytes received");
  var chars = buffer.Select(x=&gt;(char)x).ToArray();
  var message = new string(chars);
  </code></pre>