Page 1 of 1

JSON encoding / decoding for LiveCode only with livecode-script

Posted: Mon Dec 14, 2020 10:11 pm
by andresdt
Hello community
Next, we share the PhotonJSON library.
It arose from the need to have a sufficiently powerful library, with great portability and that would follow all the standards established in ECMA-404.
This library, in addition to having the previous characteristics, is written 100% in LiveCode script.

https://ferruslogic.com/photonjson-v1-0-4-released
https://github.com/Ferruslogic/PhotonJS ... tag/v1.0.4

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Tue Dec 15, 2020 3:09 pm
by bwmilby
I’ve opened a few minor issues there. I can submit one or multiple PRs if needed (edits needed are very simple). Thanks for posting this code.

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Wed Dec 16, 2020 2:12 am
by andresdt
Thank you very much bwmilby! The details are already fixed.

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Mon Jan 04, 2021 10:55 pm
by bhall2001
Can't wait to try this out. Just did a quick review of the code and looks great. Nice work!

Bob

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Tue Jan 05, 2021 3:04 pm
by andresdt
bhall2001 wrote:
Mon Jan 04, 2021 10:55 pm
Can't wait to try this out. Just did a quick review of the code and looks great. Nice work!

Bob
Thank you very much, we hope it will be very helpful.

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Thu Dec 02, 2021 2:45 pm
by andresdt
Hi everyone
We have updated the PhotonJSON library, these are the changes that the new version has.

• In this version of the library, functions that were deprecated are removed. Which makes it no longer compatible with LiveCode versions lower than 7. Thanks to @Monox18 https://github.com/Ferruslogic/PhotonJSON/issues/5 for the suggestion
• The functions that were used to detect the encoding of the input string are removed, since this string must be a UTF-8 string.
• The beautifyJSON() function is removed, because with the JSONStringify() function you can format JSON very well.

Re: JSON encoding / decoding for LiveCode only with livecode-script

Posted: Thu Jan 20, 2022 6:13 pm
by andresdt
Hi, livecoders
Version 1.2.0 of the PhotonJSON library has been released with the following changes.
  • When converting a JSON string to a LiveCode array, empty Javascript objects and arrays are no longer converted to plain empty variables. They are now converted to their LiveCode equivalent, so that the type is not lost when converting the LC Array to JSON again.
  • The "" are replaced by null when converting from array to JSON. This is for compatibility with the ECMA-404 standard.
https://github.com/Ferruslogic/PhotonJS ... tag/v1.2.0
https://ferruslogic.com/product/PhotonJSON