JSONStringToString error when input contains consecutive \uxxxx blocks
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
The function JSONStringToString gives wrong result when the input contains consecutive block of the "\uxxxx" form.
Steps to reproduce:
{$mode objfpc}
{$h+}
uses
fpjson;
var
S1, S2: TJSONStringType;
begin
repeat
write('S: ');readln(S2);
S1 := JSONStringToString(S2);
writeln(S1);
until S2='';
end.
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>fpc test.pas
Free Pascal Compiler version 3.3.1 [2021/03/14] for i386
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
Linking test.exe
14 lines compiled, 0.2 sec, 246304 bytes code, 10228 bytes data
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
S: \u0041\u0042
AAB
S: \u0041\u0042\u0043
AABC
S: \u0041\u0042\u0043\u0044
AABCCD
Additional information:
Of every block with 2 consecutive \uxxxx codes, the first one is repeated.
Mantis conversion info:
- Mantis ID: 38622
- OS: Windows
- OS Build: 10
- Build: r48960
- Platform: i386
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 48962 (#2aab9b1f)
- Target version: 4.0.0