cfrag Posted January 27, 2024 Posted January 27, 2024 If you are using lua2json with a Lua table that contains a number value set to math.huge, that value is (incorrectly) converted to 'inf' in the resulting JSON. Should you then try to load this value from the resulting JSON text file (a number with value of 'inf'), net.json2lua throws a tremendously unhelpful error: So be advised, it's NOT an invalid char at all - it's the (incorrect) 'inf' value that is passed for a number that held the value math.huge. So if you are scripting for persistence, make sure that you filter all 'inf' and replace them with large numbers before you convert to JSON. 2
Recommended Posts