Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONParseError: Unexpected o encountered #115

Open
darronschall opened this issue Jul 28, 2010 · 8 comments
Open

JSONParseError: Unexpected o encountered #115

darronschall opened this issue Jul 28, 2010 · 8 comments
Labels

Comments

@darronschall
Copy link
Contributor

Originally filed by varun.1984 on 2009-09-02T18:05:14

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
bug free

What version of the product are you using? On what operating system?
latest,windows

Please provide any additional information below.

@darronschall
Copy link
Contributor Author

Updated by darron.schall on 2009-09-03T14:11:25

Please attach the JSON string you are trying to decode so we can identify the potential issue. You might also
want to try making sure the JSON string is valid by running it through the online validator at:
http://www.jsonlint.com/

@darronschall
Copy link
Contributor Author

Updated by darron.schall on 2009-09-03T14:11:35

Original ticket set status to NeedMoreInfo (we converted to open)

@darronschall
Copy link
Contributor Author

Updated by mopics25 on 2009-11-20T12:53:09

here's some code that gives this Error :

@darronschall
Copy link
Contributor Author

Updated by scitronpousty on 2010-01-07T21:56:45

I checked my JSON on jsonlint and it validates and I also get the unexpected o issue.
I searched for a word beginning with o that was not escaped properly and cannot find it.

@darronschall
Copy link
Contributor Author

Updated by scitronpousty on 2010-01-07T22:02:31

Parsing works though if I use this construct instead:

var decoder:JSONDecoder = new JSONDecoder(resultString);
var resultObject:Object = (decoder.getValue() as Object);
var features:Array = new Array(resultObject["features"]);

@darronschall
Copy link
Contributor Author

Updated by rahul.schaudhary on 2010-02-09T11:59:20

I have also fallen into same situation. The only difference is that I am getting-
Unexpected j error.

I also have validated my JSON string using the tool provided.
Do we have some solution to it?

@darronschall
Copy link
Contributor Author

Updated by ugommirikwe on 2010-04-13T12:34:51

I had the same issue too, but I discovered the problem was that I didn't indicate in
the "resultFormat" property of the HTTPService object as "text". I change this
property to text and that error went away. Infact you don't have to use the method
suggested by scitronpousty; just write your code the normal way: JSON.decode
(e.result.toString())..

Hope this helps someone.

@darronschall
Copy link
Contributor Author

Updated by Benjamin.Lowenstein on 2010-07-09T22:01:36

The workaround in #5 worked well for me for this exact error.

import com.adobe.serialization.json.JSONDecoder;

var decoder:JSONDecoder = new JSONDecoder(myJSONstring);
var myJSONobj:Object = (decoder.getValue() as Object);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant