I found that SuperObject support for Chinese (or Unicode) in some places is not expected, and now a special post is proposed for the master to identify. The

following examples will have garbled characters, although there may be workarounds, but if it is not garbled, it will be too All right!

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type 
  TForm1 =class (TForm)
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click (Sender: TObject);
    procedure Button2Click (Sender: TObject);
    procedure Button3Click (Sender: TObject);
    procedure Button4Click (Sender: TObject);
  end ;

var
  Form1: TForm1;

implementation

{$ R * .dfm}

uses SuperObject;

procedure TForm1.Button1Click (Sender: TObject);
var
  jo: ISuperObject;
  stream: TStream;
begin
  stream: = TMemoryStream.Create;

  jo: = SO ('{"Language": "Simplified Chinese"}');
  jo.SaveTo (stream, False, False);

  stream.Position: = 0;
  Memo1.Lines.LoadFromStream (stream); // {"Language": "€ S-?}

  stream.Free;
end ;

procedure TForm1.Button2Click (Sender: TObject);
const 
  FilePath ='C: \ Temp \ Test.txt';
var
  jo: ISuperObject;
begin 
  jo: = SO ('{"Language": "Simplified Chinese"}');
  jo.SaveTo (FilePath, False, False);

  with TStringList.Createdo
  begin
    LoadFromFile (FilePath);
    ShowMessage (Text);       // {"Language": "€ S-?}
    Free;
  end ;
end ;

procedure TForm1.Button3Click (Sender: TObject);
var
  jo: ISuperObject;
  stream: TStream;
begin 
  stream: = TStringStream.Create ('{"Language": "Simplified Chinese"}');

  jo: = TSuperObject.ParseStream (stream);
  ShowMessage (jo.AsJSon (False, False));    // {"Language": "¼òÌåÖÐÎÄ"}

  stream.Free;
end ;

procedure TForm1.Button4Click (Sender: TObject);
const 
  FilePath ='C: \ Temp \ Test.txt';
var
  jo: ISuperObject;
begin
  with TStringList.Createdo
  begin 
    Add ('{"Language": "Simplified Chinese"}');
    SaveToFile (FilePath);
    Free;
  end ;

  jo: = TSuperObject.ParseFile (FilePath);
  ShowMessage (jo.AsJSon (False, False));    // {"Language": "¼òÌåÖÐÎÄ"}
end ;

end . 


Here is a temporary workaround for the above problem:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type 
  TForm1 =class (TForm)
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click (Sender: TObject);
    procedure Button2Click (Sender: TObject);
    procedure Button3Click (Sender: TObject);
    procedure Button4Click (Sender: TObject);
  end ;

var
  Form1: TForm1;

implementation

{$ R * .dfm}

uses SuperObject;

procedure TForm1.Button1Click (Sender: TObject);
var
  jo: ISuperObject;
  stream: TStream;
begin
  stream: = TMemoryStream.Create;

  jo: = SO ('{"Language": "Simplified Chinese"}');
  jo.SaveTo (stream, False, True);

  stream.Position: = 0;
  Memo1.Lines.LoadFromStream (stream); // "" Language ":" \ u7b80 \ u4f53 \ u4e2d \ u6587 "}

  stream.Position: = 0;
  jo: = TSuperObject.ParseStream (stream);
  ShowMessage (jo.AsString);            // {"Language": "Simplified Chinese"}

  stream.Free;
end ;

procedure TForm1.Button2Click (Sender: TObject);
const 
  FilePath ='C: \ Temp \ Test.txt';
var
  jo: ISuperObject;
begin 
  jo: = SO ('{"Language": "Simplified Chinese"}');
  jo.SaveTo (FilePath, False, True);

  with TStringList.Createdo
  begin
    LoadFromFile (FilePath);
    ShowMessage (Text);       // {"Language": "\ u7b80 \ u4f53 \ u4e2d \ u6587"}
    Free;
  end ;
end ;

procedure TForm1.Button3Click (Sender: TObject);
var
  jo: ISuperObject;
  stream: TStream;
begin 
  stream: = TStringStream.Create ('{"Language": "\ u7b80 \ u4f53 \ u4e2d \ u6587"}');

  jo: = TSuperObject.ParseStream (stream);
  ShowMessage (jo.AsJSon (False, False));    // {"Language": "Simplified Chinese"}

  stream.Free;
end ;

procedure TForm1.Button4Click (Sender: TObject);
const 
  FilePath ='C: \ Temp \ Test.txt';
var
  jo: ISuperObject;
begin
  with TStringList.Createdo
  begin 
    Add ('{"Language": "Simplified Chinese"}');
    SaveToFile (FilePath);
    Free;
  end ;

  Memo1.Lines.LoadFromFile (FilePath);
  jo: = SO (Memo1.Text);
// jo: = TSuperObject.ParseFile (FilePath);
  ShowMessage (jo.AsJSon (False, False));    // {"Language": "Simplified Chinese"}
end ;

end .