瀏覽代碼

fcl-json: fixed UseUTF8=false

git-svn-id: trunk@38257 -
Mattias Gaertner 7 年之前
父節點
當前提交
232195ee95
共有 1 個文件被更改,包括 6 次插入1 次删除
  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
   P : TJSONParser;
+  AOptions: TJSONOptions;
 
 begin
   Data:=Nil;
-  P:=TJSONParser.Create(AStream,[joUTF8]);
+  AOptions:=[];
+  if AUseUTF8 then
+    Include(AOptions,joUTF8);
+  P:=TJSONParser.Create(AStream,AOptions);
   try
     Data:=P.Parse;
   finally
@@ -146,6 +150,7 @@ end;
 procedure TJSONParser.NumberValue(const AValue: TJSONStringType);
 begin
   // Do nothing
+  if AValue='' then ;
 end;
 
 procedure TJSONParser.IntegerValue(const AValue: integer);