JsonReader fails to read string with escaped Backslashes
See original GitHub issueAs I updated the project today I wondered about a json-parsing error. Using 1.3.2-Snapshot (23.08.2014).
String fails0 = "{text: meow\\meow}";
String fails1 = "{text: \"meow \\ \" }";
String fails2 = "{text: \"meow \\ \" }";
String works = "{text: \"meow \\\"meow\\\"\" }";
JsonReader jsonReader = new JsonReader();
JsonValue jsonValue = jsonReader.parse(test);
fail0 worked in 1.2.0, (maybe in some 1.3.2 version but I am not sure) fails1 throws: Illegal escaped character: \ fails2 throws: Error parsing JSON, unmatched brace. Cheers
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
When parse the string to JsonElement, how to avoid auto read ...
I want to use gson to parse this str to jsonElement. eg. ... It seems like when JsonReader meet the '\', it will...
Read more >Backslash not properly escaped in server-generated JSON
An error occurs when calling the javascript JSON.parse() function, and for this reason, the entire file list is not displayed in the Devices ......
Read more >Solved: Invalid JSON. An unrecognized escape sequence '\T'...
JSON use it to escape special characters in strings and in order to represent a backslash correctly in strings you have to prepend...
Read more >Parse JSON string that contains file path : r/csharp - Reddit
Looks like JSON wants the backslashes escaped, and trying to do this without a @ verbatim string is a nightmare. It's generally a...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
these String literals except works01 don’t compile (they do after your edit)
thanks made it clear 👍