Library Cannot Parse JSON File It Wrote #4448
Labels
solution: invalid
the issue is not related to the library
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Description
I used the JSON library to "pretty-print" a JSON file. I then read that JSON file into a character array variable and the parser terminated on error. This has happened with several JSON files; I am submitting a minimal example.
Reproduction steps
I created the following file named "minimal.json" using Notepad++ on Windows. It contains four lines, including a blank last line:
{
"LABEL": 0.0
}
I then wrote the attached C++ program and built it using Cygwin.
g++ -g -DLINUX -Ijson/single_include json_test.cpp
I ran the executable with no command line inputs so that it read "minimal.json" and wrote "min_output.json". I then renamed "min_output.json" to "minimal_BadChar.json" and ran the program again, this time with a command line argument so that it read this file. The parser terminated on error with a message about an invalid input.
minimal.json
minimal_badChar.json
json_test.cpp.txt
Expected vs. actual results
I would expect the code to be able to read a file that it wrote.
Minimal code example
Error messages
Compiler and operating system
Cyrwin g++ 11.3.0
Library version
3.11.3
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: