JSON encoding / decoding for LiveCode only with livecode-script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
JSON encoding / decoding for LiveCode only with livecode-script
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
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
Last edited by andresdt on Mon Jan 25, 2021 7:45 pm, edited 2 times in total.
Re: JSON encoding / decoding for LiveCode only with livecode-script
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.
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
Re: JSON encoding / decoding for LiveCode only with livecode-script
Thank you very much bwmilby! The details are already fixed.
Re: JSON encoding / decoding for LiveCode only with livecode-script
Can't wait to try this out. Just did a quick review of the code and looks great. Nice work!
Bob
Bob
Re: JSON encoding / decoding for LiveCode only with livecode-script
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.
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
Hi, livecoders
Version 1.2.0 of the PhotonJSON library has been released with the following changes.
https://ferruslogic.com/product/PhotonJSON
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://ferruslogic.com/product/PhotonJSON