[Func] JSON-like (de)serializer (AHK-L)

Post your working scripts, libraries and tools for AHK v1.1 and older
VxE
Posts: 45
Joined: 30 Sep 2013, 10:35
Location: Simi Valley, CA

[Func] JSON-like (de)serializer (AHK-L)

30 Sep 2013, 10:53

This package includes two functions:
JSON_FromObj takes an object and returns a string that expresses the object's contents.
JSON_ToObj takes a JSON-formatted string and returns an object containing the structured data it represents.

                AHK-Lib-JSON.zip

                Also on GitHub

The serializer does not conform exactly to the official JSON standard (see http://www.json.org). See the included README for details.
Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: [Func] JSON-like (de)serializer (AHK-L)

01 Oct 2013, 11:15

VxE wrote:The serializer does not conform exactly to the official JSON standard (see http://www.json.org). See the included README for details.
So the generated json strings aren't useable in php scripts?
"Nothing is quieter than a loaded gun." - Heinrich Heine
VxE
Posts: 45
Joined: 30 Sep 2013, 10:35
Location: Simi Valley, CA

Re: [Func] JSON-like (de)serializer (AHK-L)

01 Oct 2013, 11:48

Alibaba wrote:So the generated json strings aren't useable in php scripts?
I'm not sure what you mean... I don't know what php considers "usable".

That disclaimer is there because I was annoyed at all of the other JSON libraries that claim (either directly or implicitly) to completely conform to the standard, when they do not.

The major points of non-conformance in my "stringify" function are:
  • Numbers with an exponent (e.g: 123e+45) are treated as strings. The JSON standard sees them as numbers.
    Hexadecimal numbers are treated as numbers. The JSON standard sees them as strings.
Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: [Func] JSON-like (de)serializer (AHK-L)

01 Oct 2013, 11:56

Ok, this are very little differences to the standard, i don't think they mind.
"Nothing is quieter than a loaded gun." - Heinrich Heine
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: [Func] JSON-like (de)serializer (AHK-L)

31 Jan 2014, 08:23

Very nice functions VxE :) What exactly is required to use your code as far as the copyright? Can I use it in my scripts? Can I edit the code?
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
VxE
Posts: 45
Joined: 30 Sep 2013, 10:35
Location: Simi Valley, CA

Re: [Func] JSON-like (de)serializer (AHK-L)

02 Feb 2014, 13:16

You have permission to use the code in any manner you see fit, as long as you meet the conditions of the license, which basically says you must include the copyright notice and license text with any distributions that include the function code.

It's a very loose license.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 105 guests