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

decode will not decode an encoded table #72

Open eladbs opened 3 years ago

eladbs commented 3 years ago

Hi, Using lua v5.1 and lua-cjson v2.1.0.6-1.

Why print(cjson.decode(cjson.encode({success = true}))) results in "" (an empty line) and not {success = true}? What am I missing?!

Thanks!

rodriguez-facundo commented 3 years ago

try

print(cjson.encode(cjson.decode(cjson.encode({success = true}))))