mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 20:49:14 +02:00
* Reversed default. Using UTF8 is now the default, old behaviour can be restored
git-svn-id: trunk@21838 -
This commit is contained in:
parent
a7d55bc92b
commit
8d6557ec35
@ -45,8 +45,8 @@ Type
|
||||
Property Scanner : TJSONScanner read FScanner;
|
||||
Public
|
||||
function Parse: TJSONData;
|
||||
Constructor Create(Source : TStream; AUseUTF8 : Boolean = False); overload;
|
||||
Constructor Create(Source : TJSONStringType; AUseUTF8 : Boolean = False); overload;
|
||||
Constructor Create(Source : TStream; AUseUTF8 : Boolean = True); overload;
|
||||
Constructor Create(Source : TJSONStringType; AUseUTF8 : Boolean = True); overload;
|
||||
destructor Destroy();override;
|
||||
// Use strict JSON: " for strings, object members are strings, not identifiers
|
||||
Property Strict : Boolean Read FStrict Write SetStrict;
|
||||
@ -272,14 +272,14 @@ begin
|
||||
Raise EJSONParser.Create(S);
|
||||
end;
|
||||
|
||||
constructor TJSONParser.Create(Source: TStream; AUseUTF8 : Boolean = False);
|
||||
constructor TJSONParser.Create(Source: TStream; AUseUTF8 : Boolean = True);
|
||||
begin
|
||||
Inherited Create;
|
||||
FScanner:=TJSONScanner.Create(Source);
|
||||
UseUTF8:=AUseUTF8;
|
||||
end;
|
||||
|
||||
constructor TJSONParser.Create(Source: TJSONStringType; AUseUTF8 : Boolean = False);
|
||||
constructor TJSONParser.Create(Source: TJSONStringType; AUseUTF8 : Boolean = True);
|
||||
begin
|
||||
Inherited Create;
|
||||
FScanner:=TJSONScanner.Create(Source);
|
||||
|
@ -67,8 +67,8 @@ type
|
||||
procedure Error(const Msg: string; Args: array of Const);overload;
|
||||
function DoFetchToken: TJSONToken;
|
||||
public
|
||||
constructor Create(Source : TStream; AUseUTF8 : Boolean = False); overload;
|
||||
constructor Create(const Source : String; AUseUTF8 : Boolean = False); overload;
|
||||
constructor Create(Source : TStream; AUseUTF8 : Boolean = True); overload;
|
||||
constructor Create(const Source : String; AUseUTF8 : Boolean = True); overload;
|
||||
destructor Destroy; override;
|
||||
function FetchToken: TJSONToken;
|
||||
|
||||
@ -107,7 +107,7 @@ const
|
||||
|
||||
implementation
|
||||
|
||||
constructor TJSONScanner.Create(Source : TStream; AUseUTF8 : Boolean = False);
|
||||
constructor TJSONScanner.Create(Source : TStream; AUseUTF8 : Boolean = True);
|
||||
|
||||
begin
|
||||
FSource:=TStringList.Create;
|
||||
@ -115,7 +115,7 @@ begin
|
||||
FUseUTF8:=AUseUTF8;
|
||||
end;
|
||||
|
||||
constructor TJSONScanner.Create(const Source : String; AUseUTF8 : Boolean = False);
|
||||
constructor TJSONScanner.Create(const Source : String; AUseUTF8 : Boolean = True);
|
||||
begin
|
||||
FSource:=TStringList.Create;
|
||||
FSource.Text:=Source;
|
||||
|
Loading…
Reference in New Issue
Block a user