Hi all i am facing a problem with parsing JSON with spaces in strings
This is my the JSON i am trying to parse:
I used this tool http://basic4ppc.com:51042/json/index.html
and the code i use for parsing is this:
I obtain an error saying:
The char at position 297 corresponds at the space in the string.
The error seems to happen because the parser removes the quetes from the JSON string.
How can i avoid this error?
Thanks in advance
This is my the JSON i am trying to parse:
B4X:
{
"523D837E66FF3EA3FE892ACFECA6112112984710068A03A367C22D04C8618242": "Colleghi",
"1705C6D36D0987B429A32DCF5A174339F9FD15B5E5011D2FB662FDAB7B2504D4": "Familiari2",
"A06D3D4AFC9D233276FBD6969C625B77CD6EEA103346B1B6D575C07C8C523D72": "Amici2",
"41944DF4B2A83B5A85F14DFFA6F8212A3373B4E141B00F2489B4974F36EE8A1B": "This is a test"
}
I used this tool http://basic4ppc.com:51042/json/index.html
and the code i use for parsing is this:
B4X:
Dim DecoderNomiRealiListe As JSONParser
DecoderNomiRealiListe.Initialize(NomiRealiListe)
Dim NomiRealiListeDecodificate As Map = DecoderNomiRealiListe.NextObject
I obtain an error saying:
B4X:
org.json.JSONException: Unterminated object at character 297 of {523D837E66FF3EA3FE892ACFECA6112112984710068A03A367C22D04C8618242=Colleghi, 1705C6D36D0987B429A32DCF5A174339F9FD15B5E5011D2FB662FDAB7B2504D4=Familiari2, A06D3D4AFC9D233276FBD6969C625B77CD6EEA103346B1B6D575C07C8C523D72=Amici2, 41944DF4B2A83B5A85F14DFFA6F8212A3373B4E141B00F2489B4974F36EE8A1B=This is a test}
The char at position 297 corresponds at the space in the string.
The error seems to happen because the parser removes the quetes from the JSON string.
How can i avoid this error?
Thanks in advance