I have txt file that contains json formatted data. file content looks like:
My conversion code is;
byte[] fileContent = // Read txt file
JournalFake journalFake = JsonConvert.DeserializeObject<JournalFake>(Encoding.UTF8.GetString(fileContent), new LineNumberConverter());
If I observe value of Encoding.UTF8.GetString(fileContent)
with Quick Watch, value of Encoding.UTF8.GetString(fileContent)
is below;
When I copy this json data to jsoneditoronline.org to check if json is valid, it gives me an error like below(a dot appears at the head of json file).
If I run JournalFake journalFake = JsonConvert.DeserializeObject<JournalFake>(Encoding.UTF8.GetString(fileContent), new LineNumberConverter());
statement,
it throws an error: unexpected character encountered while parsing value . path '' line 0 position 0
What goes wrong? Any help?