You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local cjson = require "cjson"
local function load_file(user_conf_file)
local f = io.open(user_conf_file)
if not f then
return nil
end
local cont = f:read("*a")
f:close()
local fjson = cjson.decode(cont)
for k, v in pairs(fjson) do
print(k)
end
return true
end
The output order is different each time,such as1432, 3142 .
So what is the sorting basis for key values after decode? Is there a way to guarantee the original order?
The text was updated successfully, but these errors were encountered:
Here is the content of json file
here is my code
The output order is different each time,such as1432, 3142 .
So what is the sorting basis for key values after
decode
? Is there a way to guarantee the original order?The text was updated successfully, but these errors were encountered: