janssonr

From MaRDI portal
Janssonr




Description

An R-safe profile of RFC 8259 JSON: parsing and generation backed by the 'Jansson' C library, linked as a system library where one is available and compiled from the bundled sources otherwise. The parser rejects, with classed conditions carrying line, column, and byte position: malformed or truncated input, trailing content, duplicate object keys at any depth, invalid UTF-8, escapes encoding a null character, reals overflowing double, and integer literals whose magnitude exceeds 2^53, the range within which a double represents every integer exactly. Number literals with a fraction or exponent convert by ordinary correctly rounded IEEE 754 double conversion. Objects decode to named lists in key order, arrays to unnamed lists, and scalars to length-one vectors. The encoder maps named lists to objects in insertion order, unnamed lists to arrays, guarantees that every finite double, signed zero included, round-trips to the exact same value (whole-number doubles are written as integers), and refuses values with no faithful JSON representation (NA, NaN, infinities, named atomic vectors, classed objects) instead of guessing. No R package dependencies.






This page was built for software: janssonr