1

I'm using SBJson to parse by JSON string. Some requests return somethink like this:

{
"jsonResponse":[{  
"id":"2",  
"name":"Somename",  
"title":"Json problem:"ErrorParsing"", //problem is here. with double quotations. how to remove them or remove error? When i delete brackets before and after ErrorParsing, it works good.  
"otherinfo":"blabla",  
}]
}
znq
  • 44,613
  • 41
  • 116
  • 144
Timur Mustafaev
  • 4,869
  • 9
  • 63
  • 109

3 Answers3

4

Those aren’t brackets; they’re (double) quotes/quotation marks. In valid JSON, quotation marks inside strings must be escaped with \, e.g. "Hello \"World\"".

The Web service you’re using is returning invalid JSON.

http://jsonlint.com is a useful resource to validate JSON strings.

1

I believe you mean "double quotes," not "double brackets." You'll need to use different quotes there, so something like:

"title":"Json problem:'ErrorParsing'"
Tim
  • 59,527
  • 19
  • 156
  • 165
  • I can't contol web response, i receive it, and I need to parse it:) – Timur Mustafaev Sep 13 '11 at 14:05
  • 1
    In that case (and in agreement with @Bavarious' answer), you're **not** receiving valid JSON. You'll need to work around this problem with the Web service. – Tim Sep 13 '11 at 16:46
0

Correct json must be

{
"jsonResponse":[{  
"id":"2",  
"name":"Somename",  
"title":"Json problem:\"ErrorParsing\"", //problem is here. with double quotations. how to remove them or remove error? When i delete brackets before and after ErrorParsing, it works good.  
"otherinfo":"blabla",  
}]
}

I think you got the point

rishad2m8
  • 1,365
  • 20
  • 27