crash with ',' sign after last array element in JSON
Original Reporter info from Mantis: Awkward
-
Reporter name:
Original Reporter info from Mantis: Awkward
- Reporter name:
Description:
when i use fpjson and jsonparser units and pass string like
'[''something'',{"text":"1234"},200, null,]' i got "Unexpected token (]) encountered." message
first array element rounded with single quotes - JSON5 accepts it but last empty element from that standard not accepted.
Steps to reproduce:
uses
sysutils,
fpjson,jsonparser;
var
res:string;
P : TJSONParser;
J : TJSONData;
begin
res:='[''babylon'', {"Text":"\u0417\u0432\u0435\u0437\u0434"}, 200, null, null,]';
P:=TJSONParser.Create(res);
Try
J:=P.Parse;
writeln('ok');
finally
FreeAndNil(J);
FreeAndNil(P);
end;
end.
Mantis conversion info:
- Mantis ID: 36724
- Version: 3.3.1