Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Michael Van Canneyt via fpc-pascal



On Sun, 14 Mar 2021, Sven Barth via fpc-pascal wrote:


On Sun, Mar 14, 2021 at 4:15 PM Michael Van Canneyt via fpc-pascal
 wrote:


Fixed. Thanks for the patch.
There was a second issue, which is now also fixed.


You set target to fpc 4.0
The simple patch I made can be backported/merged to 3.2 fixes branch?


Well, 4.0 is the only "future" version.
There is not yet a 3.2.4 planned.
We don't know what the next version is, so I chose what is available.



Why not merge it to 3.2.1 regardless? After all we'll tag the final 3.2.2
from the fixes branch again and there are already some other fixes that
will be in the final that aren't in the RC yet.


No worries; I was planning to merge to fixes.

But whether it should be in 3.2.2, I don't know yet, 
there is a related bugreport which indicates that the bug is deeper than expected.


In each case, there is no 3.2.4, so currently 4.0 is the only future
version. I mark all bugs I fix for that version currently.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal 
schrieb am So., 14. März 2021, 18:03:

>
>
> On Sun, 14 Mar 2021, Bart via fpc-pascal wrote:
>
> > On Sun, Mar 14, 2021 at 4:15 PM Michael Van Canneyt via fpc-pascal
> >  wrote:
> >
> >> Fixed. Thanks for the patch.
> >> There was a second issue, which is now also fixed.
> >
> > You set target to fpc 4.0
> > The simple patch I made can be backported/merged to 3.2 fixes branch?
>
> Well, 4.0 is the only "future" version.
> There is not yet a 3.2.4 planned.
> We don't know what the next version is, so I chose what is available.
>

Why not merge it to 3.2.1 regardless? After all we'll tag the final 3.2.2
from the fixes branch again and there are already some other fixes that
will be in the final that aren't in the RC yet.

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Michael Van Canneyt via fpc-pascal



On Sun, 14 Mar 2021, Bart via fpc-pascal wrote:


On Sun, Mar 14, 2021 at 4:15 PM Michael Van Canneyt via fpc-pascal
 wrote:


Fixed. Thanks for the patch.
There was a second issue, which is now also fixed.


You set target to fpc 4.0
The simple patch I made can be backported/merged to 3.2 fixes branch?


Well, 4.0 is the only "future" version.
There is not yet a 3.2.4 planned. 
We don't know what the next version is, so I chose what is available.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Bart via fpc-pascal
On Sun, Mar 14, 2021 at 4:15 PM Michael Van Canneyt via fpc-pascal
 wrote:

> Fixed. Thanks for the patch.
> There was a second issue, which is now also fixed.

You set target to fpc 4.0
The simple patch I made can be backported/merged to 3.2 fixes branch?


-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Michael Van Canneyt via fpc-pascal



On Sun, 14 Mar 2021, Bart via fpc-pascal wrote:


On Sun, Mar 14, 2021 at 2:55 PM Bart  wrote:


I think I have a fix, will report it.


Reported as https://bugs.freepascal.org/view.php?id=38622
Possible patch attached in the bugreport.


Fixed. Thanks for the patch.
There was a second issue, which is now also fixed.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Michael Van Canneyt via fpc-pascal



On Sun, 14 Mar 2021, Bart via fpc-pascal wrote:


On Sun, Mar 14, 2021 at 12:43 AM Michael Van Canneyt via fpc-pascal
 wrote:


> Do I misunderstand the purpose of this function or is this a bug?

Seems like a bug.


I'll report it then.
Do you know if we have a test suite for this function, so I can test
if there ar regressions when I try to fix it?


The JSON classes use this function. 
There is a JSON testsuite. Just run that.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Bart via fpc-pascal
On Sun, Mar 14, 2021 at 2:55 PM Bart  wrote:

> I think I have a fix, will report it.

Reported as https://bugs.freepascal.org/view.php?id=38622
Possible patch attached in the bugreport.

-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Bart via fpc-pascal
On Sun, Mar 14, 2021 at 1:49 PM Bart  wrote:

> Do you know if we have a test suite for this function, so I can test
> if there ar regressions when I try to fix it?

Found it already.
I think I have a fix, will report it.


-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Bart via fpc-pascal
On Sun, Mar 14, 2021 at 12:43 AM Michael Van Canneyt via fpc-pascal
 wrote:

> > Do I misunderstand the purpose of this function or is this a bug?
>
> Seems like a bug.

I'll report it then.
Do you know if we have a test suite for this function, so I can test
if there ar regressions when I try to fix it?


-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSONStringToString question

2021-03-13 Thread Michael Van Canneyt via fpc-pascal



On Sat, 13 Mar 2021, Bart via fpc-pascal wrote:


From : 
https://www.freepascal.org/docs-html/current/fcl/fpjson/jsonstringtostring.html

Function result
Pascal string with escaped characters replaced

{$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.2.0 [2020/06/04] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
Linking test.exe
15 lines compiled, 0.2 sec, 233536 bytes code, 10196 bytes data

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
S: \u0041\
A (as expected)
S: \u0042
B (as expected)
S: \"\u0041\
"A (as expected)
S: \"\u0041\"
"A" (as expected)
S: \u0041\u0042
AAB (Huh??)

Do I misunderstand the purpose of this function or is this a bug?


Seems like a bug.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] JSONStringToString question

2021-03-13 Thread Bart via fpc-pascal
From : 
https://www.freepascal.org/docs-html/current/fcl/fpjson/jsonstringtostring.html

Function result
Pascal string with escaped characters replaced

{$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.2.0 [2020/06/04] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
Linking test.exe
15 lines compiled, 0.2 sec, 233536 bytes code, 10196 bytes data

C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
S: \u0041\
A (as expected)
S: \u0042
B (as expected)
S: \"\u0041\
"A (as expected)
S: \"\u0041\"
"A" (as expected)
S: \u0041\u0042
AAB (Huh??)

Do I misunderstand the purpose of this function or is this a bug?

-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal