[fpc-pascal] [Lazarus] Tests results of several pascal based JSON parsers
Michael Van Canneyt
michael at freepascal.org
Sat Aug 31 08:27:35 CEST 2019
On Fri, 30 Aug 2019, Anthony Walter via lazarus wrote:
> Okay, so I turned on my Windows VM with a different version of FPC and ran
> VerifyUnicodeChars with both FPJson and JsonTools. The resutls are the
> same. JsonTools sees the unicode correctly, and something is wrong when
> using FPJson. I don't know what the problem is, but other people are
> noticing similar issues, so it would seem there is definitely a problem
> resulting in a failure for FPJson.
>
> Michael, you have all the information needed to find out what's wrong and
> I'd be curious to learn why it's not working.
Allow me to correct you, I don't have all information:
1. Did you run my provided test program on linux ?
(the first one I sent, not the one for the speed test)
If my test program also shows different results on your machine,
indeed something strange is going on.
The reason I insist on the us of my test program and not yours,
is that the result can be influenced by some unknown units or whatnot in yours,
and my program is "bare bones".
On the assumption my private computer can be somehow 'compromised' by years
of FPC development I even copied my program to 2 other linux machines,
used for production work, and the result is 'True' on both.
(see log below for one of them, this is with standard ubuntu installed compiler)
I can believe the program would output something different on Windows,
but not on another linux box.
2. Where is the source code of your test program(s) ?
At least the ones for fpjson and jsontools.
Without your actual source code, I cannot give advice or investigate properly.
I'd like to see this cleared up. fpjson has been in use in many REST
services in large production sites for at least 8 years, these services
definitely use UTF8 content outside the basic ASCII or even ANSI codepages.
So the failures you see are highly surprising to me, to say the least.
Michael.
Copy&paste from a quick sompile session.
----
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-34-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Keen to learn Istio? It's included in the single-package MicroK8s.
https://snapcraft.io/microk8s
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
_____
/ ___/___ _ _ _____ _ ___ ___
| | / _ \| \| |_ _/ \ | _ )/ _ \
| |__| (_) | .` | | |/ _ \| _ \ (_) |
\____\___/|_|\_| |_/_/ \_|___/\___/
Welcome!
This server is hosted by Contabo. If you have any questions or need help,
please don't hesitate to contact us at support at contabo.com.
Last login: Tue Aug 20 14:23:39 2019 from 81.82.199.218
root at vmi203569:~# fpc twalter.pas -S2
Free Pascal Compiler version 3.0.4+dfsg-18ubuntu1 [2018/07/02] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling twalter.pas
Linking twalter
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
26 lines compiled, 0.4 sec
root at vmi203569:~# ./twalter
Handles unicode chars correctly: >{ "name": "Joe®Schmoe", "occupation": "bank teller \u00Ae " }<
TRUE
More information about the fpc-pascal
mailing list