git-svn-id: trunk@48965 -
This commit is contained in:
michael 2021-03-14 15:04:12 +00:00
parent 74854eee58
commit 0d1fb41901
3 changed files with 16 additions and 1 deletions

View File

@ -254,7 +254,7 @@ var
I : Integer;
OldLength, SectionLength, tstart,tcol, u1,u2: Integer;
C , c2: char;
S : String[4];
S : String[8];
Line : String;
IsStar,EOC: Boolean;
@ -274,6 +274,7 @@ var
FCurTokenString:=FCurTokenString+U;
OldLength:=Length(FCurTokenString);
u1:=0;
u2:=0;
end;
end;

View File

@ -4037,6 +4037,7 @@ procedure TTestJSONString.TestJSONStringToString;
Const
// Glowing star in UTF8
GlowingStar = #$F0#$9F#$8C#$9F;
Chinese = #$95e8#$88ab#$8111#$5b50#$6324#$574f#$4e86;
begin
TestFrom('','');
@ -4080,6 +4081,7 @@ begin
TestFrom('\u0041\u0042','AB'); //issue #0038622
TestFrom('\u0041\u0042\u0043','ABC');
TestFrom('\u0041\u0042\u0043\u0044','ABCD');
TestFrom('\u95e8\u88ab\u8111\u5b50\u6324\u574f\u4e86',Utf8Encode(Chinese));
end;
procedure TTestJSONString.TestStringToJSONString;

View File

@ -314,10 +314,22 @@ end;
procedure TBaseTestReader.TestString;
const
GlowingStar = #$F0#$9F#$8C#$9F;
Chinese = #$95e8#$88ab#$8111#$5b50#$6324#$574f#$4e86;
begin
DoTestString('A string');
DoTestString('');
DoTestString('\"','"');
DoTestString('\u00f8','ø'); // this is ø
DoTestString('\u00f8\"','ø"'); // this is ø"
DoTestString('\ud83c\udf1f',GlowingStar);
DoTestString('\u0041\u0042','AB'); //issue #0038622
DoTestString('\u0041\u0042\u0043','ABC');
DoTestString('\u0041\u0042\u0043\u0044','ABCD');
DoTestString('\u95e8\u88ab\u8111\u5b50\u6324\u574f\u4e86',Utf8Encode(Chinese));
end;