Repository navigation
Conversation
When running this code in locales that do not use a period for floating point integers, an error would occur. This is now resolved.
|
A bit of clarification. json.lua does not work on locales that use a decimal comma instead of a decimal point for floating point numbers, causing a Lua exception. There are about 80 countries who use decimal comma's. |
|
My understanding of the JSON specification is that only the |
|
You are correct that it's in the JSON spec. However, this is a situation where the spec shouldn't come into play because of how Lua handles changing the locale.
The way you check if a JSON key with an integer is valid is a good way to check for valid numbers. But it still should adapt to Lua no matter what locale is being used. |
previous version was replacing minus sign in negative numbers in error.
- Add Lua 5.5 compatibility (use table.unpack, math.tointeger) - Rewrite encoder/decoder to use a rope for O(n) performance (rxi#46) - Encode numbers with %.17g for lossless 64-bit float round-trip (rxi#42) - Handle nil values in arrays by emitting null (rxi#52) - Sort object keys for deterministic output (rxi#51) - Support numeric table keys (rxi#43) - Encode empty tables as [] by default, with force_object option (rxi#40) - Add SPARSELIMIT for sparse array handling (rxi#28) - Make number parsing locale-independent (rxi#20) - Bump version to 0.2.0 - Update PKGBUILD for Lua 5.5 and new version - Update README with supported versions and new options - Add tests for nil arrays, sorted keys, empty tables
When running this code in locales that do not use a period for floating point integers, an error would occur. This is now resolved.