[Gambas-user] JSON Encoder

Martin mbelmonte at belmotek.net
Thu Nov 19 21:51:17 CET 2020


Hi,

I am trying to encode a json file, as source info I use a JSONCOllection 
but the result is not exactly I spect

*Sample of the expected result.*

/  {//
//      "object": "BLOCK_CONTROL",//
//      "index": 0,//
//      "type": 48,//
//      "handle": [0, 1],//
//      "size": 19,//
//      "bitsize": 72,//
//      "ownerhandle": [4, 0, 0, 0],//
//      "entries": [//
//        [2, 1, 44, 44],//
//        [2, 1, 48, 48]//
//      ],//
//      "model_space": [3, 1, 2, 2],//
//      "paper_space": [3, 1, 14, 14]//
//    },/

*JSONEncode result.  t = JSON.Encode(ox) where ox is a JSONCollection
*

/{"object":"BLOCK_CONTROL","index":0,"type":48,"handle":[0,1],"size":19,"bitsize":72,"ownerhandle":[4,0,0,0],"entries":[[2,1,44,44],[2,1,48,48]],"model_space":[3,1,2,2],"paper_space":[3,1,14,14]}/

As you see the "\n" is not present. I could try to replace coma "," by 
"\n," but structures like this [3, 1, 2, 2] will be splited also that's 
not kool.

I wan to know if I am doing something wrong for encoding?

If it is scheduled any improvement in the compoent gb.web ?

Any other idea?

Tanks for read.

Martin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201119/d0159492/attachment.htm>


More information about the User mailing list