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

improve "A JSONObject text must begin with '{' at character 1 of" error message #46

Open
ralfhauser opened this issue Aug 6, 2022 · 3 comments

Comments

@ralfhauser
Copy link

at org.codehaus.jettison.json.JSONTokener.syntaxError(JSONTokener.java:463)
at org.codehaus.jettison.json.JSONObject.(JSONObject.java:206)
at org.codehaus.jettison.json.JSONObject.(JSONObject.java:313)

and then it cites the JSON where "{" is in the first position ?!?!

==> it turns out the by moving the json file from Windows to the invisble "\uFEFF" is prefixed (byte order mark (BOM))

==> please visualize that too !

@coheigea
Copy link
Contributor

@ralfhauser Can you provide some sample json?

@NoelZehnder
Copy link

@coheigea You can find the mentiond json and a linux cmd for showing the invisible characters below:

@ralfhauser
Copy link
Author

"cat -vte " shows you

grafik

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

No branches or pull requests

3 participants