-
RFC 4627: A JSON text must be either an object or an array.
-
RFC 7159: A JSON text can be any JSON value, including objects, arrays, strings, numbers, booleans, or null.
-
RFC 4627: Was less explicit about Unicode handling, particularly for surrogate pairs.
-
RFC 7159: Clarified the handling of Unicode, especially with regards to surrogate pairs, ensuring proper representation and validation.
-
RFC 4627: Did not explicitly state limitations on number precision.
-
RFC 7159: Emphasized that implementations should not expect to process numbers exactly as received if they fall outside of what can be represented by a double-precision floating-point format (IEEE 754).
-
RFC 4627: Allowed a limited set of whitespace characters (space, tab, newline, carriage return).
-
RFC 7159: Allowed these same characters but provided more clarity on their usage.
- RFC 8259: Incorporated various editorial improvements and clarifications to enhance readability and precision without altering the technical content.
- RFC 8259: Ensured consistent terminology and definitions throughout the document.
- RFC 8259: Did not introduce major technical changes but focused on consolidating and clarifying the changes introduced in RFC 7159.
- JSON text must be an object or array.
- Less explicit about Unicode handling.
- No explicit precision constraints on numbers.
- JSON text can be any JSON value.
- Clarified Unicode handling, especially surrogate pairs.
- Advised on number precision and representation.
- Provided clearer guidance on allowed whitespace.
- Incorporated editorial improvements from RFC 7159.
- Ensured consistent terminology and definitions.
- No major technical changes from RFC 7159.
JSON5 is a superset of JSON that aims to alleviate some of the limitations of the original JSON specification by expanding its syntax to include some features from ECMAScript 5.1.
- Object keys can be ECMAScript 5.1 IdentifierNames.
- Objects can have a single trailing comma.
- Arrays can have a single trailing comma.
- Strings can be single-quoted.
- Strings can span multiple lines by escaping new line characters.
- Strings can include character escapes.
- Numbers can be hexadecimal.
- Numbers can have a leading or trailing decimal point.
- Numbers can be IEEE 754 positive infinity, negative infinity, and NaN.
- Numbers can begin with an explicit plus sign.
- Single and multi-line comments are allowed.
- Additional white space characters are allowed.
While TinyJSON is a fully compliant JSON5 parser, its write operations (dump(), write_file()) output standard RFC 8259 JSON by default (with the exception of preserving loaded comments). This makes it highly suitable for converting JSON5 documents into standard JSON.