title: "Unable to translate Unicode character" error when saving to txt file
body: <blockquote>
    <p>Additional information: Unable to
    translate Unicode character \uDFFF at
    index 195 to specified code page.</p>
  </blockquote>
  
  <p>I made an algorithm, who's result are binary values (different lengths). I transformed it into <code>uint</code>, and then into chars and saved into stringbuilder, as you can see below:</p>
  
  <pre><code>uint n = Convert.ToUInt16(tmp_chars, 2);
  _koded_text.Append(Convert.ToChar(n));
  </code></pre>
  
  <p>My problem is, that when i try to save those values into .txt i get the previously mentioned error.</p>
  
  <pre><code>StreamWriter file = new StreamWriter(filename);
              file.WriteLine(_koded_text);
              file.Close();
  </code></pre>
  
  <p>What i am saving is this: "忿췾᷿］볯褟ﶞ痢ﳻ��伞ﳴ㿯ﹽ翼蛿㐻ﰻ筹��﷿￦ﾏ랿鳿⏟麞펿"... which are some weird signs. </p>
  
  <p>What i need is to convert those binary values into some kind of string of chars and save it to txt. I saw somewhere that converting to UTF8 should help, but i don't know how to. Would changing files encoding help too?</p>