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

Post your working scripts, libraries and tools
User avatar
VxE
Posts: 44
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.
User avatar
joedf
Posts: 5414
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

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

30 Sep 2013, 20:17

Cool!
Alibaba
Posts: 427
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
User avatar
VxE
Posts: 44
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: 427
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
maestrith
Posts: 622
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?
AHK Studio OSD GUI Creator
Donations (A bit slow currently)
All code is done on a Windows 10 PC Running x64 and AutoHotkey x32
User avatar
VxE
Posts: 44
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”

Who is online

Users browsing this forum: No registered users and 8 guests