This project has moved. For the latest updates, please go here.

Boolean value - parse error

Apr 5, 2013 at 1:20 PM
Edited Apr 5, 2013 at 1:23 PM
I try to pase a simple JSON string.
string JSON = @"{""isGuest"" : True}";

JObject o = JObject.Parse(JSON);   // error
//. . . 
But an exeption occured;

'Unexpected character encountered while parsing value'

It seems that the unquoted value 'True' is the cause of the error.
I've to parse a file with several boolean values as in my example.

How can i avoid an exeption ?
Apr 5, 2013 at 1:39 PM
Are you sure this is valid JSON? I think "true" should have a lowercase T.
Apr 5, 2013 at 1:45 PM
This is just a small part of the original JSON file. In the original file it's a capital 'T'.
But the capital 'T' is causing the problem. I've changed it to lowercase and it's fixed now.
Thank you very much !!