Reputation: 1247
I'm trying to deal with JSON and I found /u200b (Zero width space) right before double values. I cant pares it right now, even setting the filed type to String. Here I can easily remove it, but how to deal with downloading content from a server?
String testJson = "{" +
" \"name\": \"Aarhus\"," +
" \"latitude\": \u200B56.3," +
" \"longitude\": \u200B10.619,"
" }";
Upvotes: 0
Views: 7095
Reputation: 87
You can try to use Jackson, it has many options such as FAIL_ON_UNKNOWN_PROPERTIES and ACCEPT_SINGLE_VALUE_AS_ARRAY. It might help
Upvotes: 0
Reputation: 801
Use the following replacement if you already have your data in a string.
testJson =testJson.replaceAll("\u200B", "");
If you need to load data from url first, then some clever ways are discussed here: Read url to string in few lines of java code
Upvotes: 4