3

I Have a json string as below:

[
  {
     "NAME" : "KANTESH",
     "SNAME" : "NAGARADDER",
     "MSG1" : "\"HELLO:HOW ARE YOU\"\n",
     "MSG2" : "\"HELLO:///HOW ARE YOU\"\n",
     "ID"   : 20074499
  }
]

when i am trying to remove the white spaces using libjson libarary function i.e json_strip_white_space() i am getting the below resulting string.

[{"NAME":"KANTESH","SNAME":"NAGARADDER","MSG1":"\"HELLO:HOW ARE YOU\"\n","MSG2":"\"HELLO:"ID":20074499}]

In the above resulting string the characters after the '///' are stripped out and concatenated with next line.

Below are my queries:
1)Why the characters after the forward slashes are stripping out.
2)Does json_strip_white_space() treats '///' as comments
3)How to overcome this problem

Please help me. Thanks,

Himanshu
  • 4,327
  • 16
  • 31
  • 39
K.H.Nagaradder
  • 71
  • 1
  • 1
  • 5
  • @AlanStokes the question you linked has been removed – Chris A Dec 03 '15 at 12:10
  • Forward slash has no significance in JSON. There is either a bug in your JSON library, or (more likely) a bug in your code. Can you post your actual c++ code? – Kip Dec 03 '15 at 19:49

0 Answers0