toJson escapes "=" unnecessarily in raw strings
See original GitHub issueWhat steps will reproduce the problem?
1. Create an object with a single String field.
2. Set field to "http://someUrl.com?a=b"
3. Attempt to convert the object to json via gson.toJson
What is the expected output? What do you see instead?
I would expect the URL to be serialized exactly as it is written. Instead,
the equals sign is encoded as \u003d.
What version of the product are you using? On what operating system?
1.4
Original issue reported on code.google.com by arcanef...@gmail.com
on 20 Apr 2010 at 5:08
Issue Analytics
- State:
- Created 9 years ago
- Comments:7
Top Results From Across the Web
How to escape special characters in building a JSON string?
Doubling a single quote in a JSON string doesn't escape it. It just means your string contains two single quotes, instead of one....
Read more >Escapes and multiline strings · YourBasic Go
Raw string literals, delimited by backticks (back quotes), are interpreted literally. They can contain line breaks, and backslashes have no special meaning.
Read more >How to use a JSON document, Utf8JsonReader, and ...
Json doesn't let you disable escaping while writing a string. However, you could pass in your own custom JavaScriptEncoder as an option to...
Read more >Swift String Cheat Sheet - Use Your Loaf
Custom delimiters become useful when we want to preserve escaped raw text. For example, when creating a String from some JSON.
Read more >string — CMake 3.25.1 Documentation
JSON string (JSON <out-var> [ERROR_VARIABLE <error-var>] {GET | TYPE ... Escaping a non-special character is unnecessary but allowed, e.g. \a matches a ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
Original comment by
Cassel.G...@gmail.com
on 30 Jul 2010 at 7:33Original comment by
sadineni...@gmail.com
on 18 Aug 2010 at 8:30