title: C# convert string Unicode to byte Ansi
body: <p>google didnt help me such as i wanted so im writing post here.
  i have Unicode string in C# and C function (in dll) which want the char(ANSI)*.
  i try to do</p>
  
  <pre><code>string tmp = "ala ma kota";
  unsafe
  {
      fixed (byte* data = &amp;tmp.ToCharArray()[0])
      {
          some_function(data);
      }
  }
  </code></pre>
  
  <p>but i cannot convert directly without encoding. I try to use Encode class but without any effects. I know that, the some_function needs to be called with char pointer. Where it points to array of byte.</p>