I created a json file inside of Visual Studio and added it as a resource to my console app. For some reason, it gets added as a byte[] which is fine. I read it like this:
string str = Encoder.UTF8.GetString(Properties.Resources.myJson);
json looks okay in the debugger, but when I call JObject.Parse(str)
it complains about a parsing error. I tracked this down to it appears there is a junk byte at the beginning. I thought UTF8 was supposed to strip off any encoding bytes? Can I always assume there will be one junk character? If I do a SubString(1), then JObject.Parse works fine.
Or is there a safer way to get the myJson byte[] into the JObject?