Issue 629 in google-gson: convert string to JSON with special character \u

11 views
Skip to first unread message

googl...@googlecode.com

unread,
Mar 2, 2015, 11:34:29 PM3/2/15
to google-gson...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 629 by nhutnguy...@gmail.com: convert string to JSON with special
character \u
https://code.google.com/p/google-gson/issues/detail?id=629

What steps will reproduce the problem?
Run this java code:
JsonParser parser = new JsonParser();
JsonElement element =
parser.parse("{\"description\":\"c:\\userDescription.txt\"}");
JsonObject attributes = element.getAsJsonObject();
System.out.println(attributes);

Expected output:
{"description":"c:\userDescription.txt"}

but actually, I see:
Exception in thread "main" com.google.gson.JsonSyntaxException:
java.lang.NumberFormatException: For input string: "serD"



I use Gson 1.5.

Please provide any additional information below.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages