Browse Source

fcl-json: fixed UseUTF8=false

git-svn-id: trunk@38257 -
Mattias Gaertner 7 years ago
parent
commit
232195ee95
1 changed files with 6 additions and 1 deletions
  1. 6 1
      packages/fcl-json/src/jsonparser.pp

+ 6 - 1
packages/fcl-json/src/jsonparser.pp

@@ -67,10 +67,14 @@ procedure DefJSONParserHandler(AStream: TStream; const AUseUTF8: Boolean; out
 
 
 Var
 Var
   P : TJSONParser;
   P : TJSONParser;
+  AOptions: TJSONOptions;
 
 
 begin
 begin
   Data:=Nil;
   Data:=Nil;
-  P:=TJSONParser.Create(AStream,[joUTF8]);
+  AOptions:=[];
+  if AUseUTF8 then
+    Include(AOptions,joUTF8);
+  P:=TJSONParser.Create(AStream,AOptions);
   try
   try
     Data:=P.Parse;
     Data:=P.Parse;
   finally
   finally
@@ -146,6 +150,7 @@ end;
 procedure TJSONParser.NumberValue(const AValue: TJSONStringType);
 procedure TJSONParser.NumberValue(const AValue: TJSONStringType);
 begin
 begin
   // Do nothing
   // Do nothing
+  if AValue='' then ;
 end;
 end;
 
 
 procedure TJSONParser.IntegerValue(const AValue: integer);
 procedure TJSONParser.IntegerValue(const AValue: integer);