At first glance you would expect an error like this:
JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING
quite simple: the JSON is incorrect.
But what if JSONLint even validates this as correct?
In this example, the code was produced by an Android App consuming a JSON interfaces produced by PHP.
And guess what?!
It was an UTF-8 encoding issue within the JSON content - a special character from a town name needed UTF-8 encoding.
This solves the issue and saved my Friday!
JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING
quite simple: the JSON is incorrect.
But what if JSONLint even validates this as correct?
In this example, the code was produced by an Android App consuming a JSON interfaces produced by PHP.
And guess what?!
It was an UTF-8 encoding issue within the JSON content - a special character from a town name needed UTF-8 encoding.
This solves the issue and saved my Friday!
Keine Kommentare:
Kommentar veröffentlichen