[fpc-pascal] JSON Test Suite

Benito van der Zander benito at benibela.de
Sun Nov 6 17:34:13 CET 2016


Hi,

it is better to use TJSONParser than GetJSON.

GetJSON is defined as:

procedure DefJSONParserHandler(AStream: TStream; const AUseUTF8: 
Boolean; out
   Data: TJSONData);

Var
   P : TJSONParser;

begin
   Data:=Nil;
   P:=TJSONParser.Create(AStream,[joUTF8]);
   try
     Data:=P.Parse;
   finally
     P.Free;
   end;
end;

with

procedure DefJSONParserHandler(AStream: TStream; const AUseUTF8: 
Boolean; out
   Data: TJSONData);

Var
   P : TJSONParser;

begin
   Data:=Nil;
   P:=TJSONParser.Create(AStream,[*joStrict,*joUTF8]);
   try
     Data:=P.Parse;
   finally
     P.Free;
   end;
end;

it should pass more


Best,

Benito



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20161106/bdc520d2/attachment.html>


More information about the fpc-pascal mailing list