title: "EF BB BF" at the beginning of JSON files created in Visual Studio
body: <p>I have a bunch of <code>JSON</code> files set as <code>Embedded resource</code> in one of my projects. I'm using <code>Newtonsoft.Json</code> to parse these files:</p>
  
  <pre><code>public static string ReadStringFromStream(string streamName)
  {
      using (System.IO.Stream stream = new EmbeddedResourceReader().GetType().Assembly.GetManifestResourceStream(streamName))
      {
          byte[] result = new byte[stream.Length];
          stream.Read(result, 0, (int)stream.Length);
          var str = Encoding.UTF8.GetString(result);
          return str;
      }
  }
  ...
  
  var traits = JsonConvert.DeserializeObject&lt;Genre[]&gt;(EmbeddedResourceReader.ReadStringFromStream("LNTCore.Genres.json"));
  Genres = traits;
  </code></pre>
  
  <p>This throws an exception in Newtonsoft.Json because it can't parse the beginning of the file. What's the best practice in this case? How should I be handling this sort of situations?</p>
  
  <p>Thanks!</p>