fyhack / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

toJson escapes "=" unnecessarily in raw strings #203

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What 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

GoogleCodeExporter commented 9 years ago
I also think this is a bug. It is causing problems when I am trying to turn 
base64 encoded string (which ends with equals sign) into JSON.

Original comment by dennis.d...@gmail.com on 11 Jun 2010 at 9:27

GoogleCodeExporter commented 9 years ago
Hope this will help you :

Gson gson = new GsonBuilder().disableHtmlEscaping().create();

Original comment by Cassel.G...@gmail.com on 30 Jul 2010 at 7:33

GoogleCodeExporter commented 9 years ago
what version of library?

Original comment by zlob...@gmail.com on 2 Aug 2010 at 2:00

GoogleCodeExporter commented 9 years ago
Working fine for me now If I use below code to create Gson object. 

Gson gson = new GsonBuilder().disableHtmlEscaping().create();

Thanks to Cassel.Guillaume.

Original comment by sadineni...@gmail.com on 18 Aug 2010 at 8:30

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 3 Sep 2010 at 6:32