* Reversed default. Using UTF8 is now the default, old behaviour can be restored

git-svn-id: trunk@21838 -
This commit is contained in:
michael 2012-07-10 09:09:38 +00:00
parent a7d55bc92b
commit 8d6557ec35
2 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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;