mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua

Home Page:https://kyne.au/~mark/software/lua-cjson.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get empty json array,use cjson

hiallo opened this issue · comments

root@tt:~# lua
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio (double int32)
> j = require 'cjson'
>
> s = {"",""}
>
> print(j.encode(s))
["",""]
> s = {nil,nil}
>
> print(j.encode(s))
{}
>

How to get empty json array,use cjson.