mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
https://kyne.au/~mark/software/lua-cjson.php
MIT License
936 stars 478 forks source link

How to get empty json array,use cjson #78

Open hiallo opened 3 years ago

hiallo commented 3 years ago
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.