Closed aph12123 closed 7 years ago
I found the problem it's the file encoding.My config file was encoded in UTF-8 with BOM by default. When read into memory it has three invisible chars in the head of the string. So it caused the cjson.decode crash.The solution is change file encode to UTF-8 then it works perfectly fine.
I have a config file whose content is organized in JSON, when I read the file from disk and assign its content to a Lua string and print shows exactly the same as the file.But when I try to decode it use cjson the console shows "Expected value but found invalid token at character 1".
Here is my file: {"apkname":"lukaYingyongbao_215_jiagu_sign.apk","verName":"2.1.5","verCode":20,"verForced":"false","appname":"撸卡漫画","title":"撸卡漫画更新啦","verInfo":"《撸卡漫画》新版本上线啦!\n主要修复版本部分机型的登录问题以及性能优化"}