Skip to content

JSON for Modern C++ Version 2.0.7

Compare
Choose a tag to compare
@nlohmann nlohmann released this 02 Nov 19:53
· 3435 commits to develop since this release
  • Release date: 2016-11-02
  • SHA-256: 5545c323670f8165bae90b9dc6078825e86ec310d96cc4e5b47233ea43715bbf

Summary

This release fixes a few bugs in the JSON parser found in the Parsing JSON is a Minefield 💣 article. The fixes are backwards compatible.

Changes

  • The article Parsing JSON is a Minefield 💣 discusses a lot of pitfalls of the JSON specification. When investigating the published test cases, a few bugs in the library were found and fixed:
    • Files with less than 5 bytes can now be parsed without error.
    • The library now properly rejects any file encoding other than UTF-8. Furthermore, incorrect surrogate pairs are properly detected and rejected.
    • The library now accepts all but one "yes" test (y_string_utf16.json): UTF-16 is not supported.
    • The library rejects all but one "no" test (n_number_then_00.json): Null bytes are treated as end of file instead of an error. This allows to parse input from null-terminated strings.
  • The string length passed to a user-defined string literal is now exploited to choose a more efficient constructor.
  • A few grammar mistakes in the README file have been fixed.