lua-cjson
lua-cjson copied to clipboard
Lua CJSON is a fast JSON encoding/parsing module for Lua
Hello. So when I try to run my Discord bot using Lacord, the Lua-Cjson module ran into a problem. You can see it in the image : 
Hi, Since this is not addressed in documentation I thought I would ask here - what's the "right" way of handling invalid JSONs without blowing up?
I'm requiring the module using ``` package.path = package.path .. ";../?.lua" local json = require('cjson') ``` And I'm getting: ``` lua: error loading module 'cjson' from file '/usr/local/lib/lua/5.3/cjson.so': dlopen(/usr/local/lib/lua/5.3/cjson.so, 6):...
``` cc -c -O3 -Wall -pedantic -DNDEBUG -I/usr/local/include -fpic -o lua_cjson.o lua_cjson.c In file included from lua_cjson.c:48: fpconv.h:15:20: warning: inline function ‘fpconv_init’ declared but never defined 15 | extern inline...
有如下代码: location /echo1 { content_by_lua ' local tb = {y=123,b=234,c=456} local cjson = require "cjson" local out = cjson.encode(tb) ngx.say(out) '; } 访问http://xxx/echo1会输出; {"y":123,"c":456,"b":234} 如何按原来的{"y":123,"b":234,"c":456} 输出?我知道hash table都是无序或者说是顺序不确定的,如何实现我上述需求?
for the latest code, I found the maximum value of encode_number_precision is 16, which is merged in commit. https://github.com/openresty/lua-cjson/commit/f79aa68af865ae84b36c7e794beedd87fef2ed54 For our scenes, we use int64 value in json strings, which...
Forward slash may be escaped according to the JSON specification. In practice, escaped forward slash is not interpreted properly by most applications that consume JSON. For instance, it's very common...
…ontains null A null pointer substitution is currently used while parsing a string contains `null`, which is not expected by those who are unaware of this rule. Is it better...
Many people are discussing how to solve the forward slash escaping problem, which shows that this is a common demand. For example: https://github.com/mpx/lua-cjson/pull/57 https://github.com/mpx/lua-cjson/issues/66 Existing solutions are changed from escaping...
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!