title: Convert string base64 to string in C# without Encoding.UTF8.GetString
body: <p>I'm trying to convert string base64 to string in C# under Unity3d. When I try to build on Windows Phone 8, an error occurs because System.Text.Encoding is not supported yet.</p>
  
  <pre><code>byte[] data = Convert.FromBase64String(encodedData);
  string decodedString = System.Text.Encoding.UTF8.GetString(data);
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <blockquote>
    <p>Exception: Error: method <code>System.Text.Encoding System.Text.Encoding::get_ASCII()</code> doesn't exist in target framework</p>
  </blockquote>
  
  <p><strong>Update:</strong></p>
  
  <p>I tried an alternative of UTF8.GetString:</p>
  
  <pre><code>public static string byteArrayToString(byte[] byteArray)
  {
      char[] chars = new char[byteArray.Length / sizeof(char)];
      System.Buffer.BlockCopy(byteArray, 0, chars, 0, byteArray.Length);
      return new string(chars);
  }
  </code></pre>
  
  <p>It's supposed to convert bytes to string, like the UTF8.GetString, but all what I got is Chinese characters! I wonder if UTF8.GetString does something other than converting bytes to string.</p>