chars get treated as JSON numbers not JSON strings #1139
Labels
solution: duplicate
the issue is a duplicate; refer to the linked issue instead
solution: wontfix
the issue will not be fixed (either it is impossible or deemed out of scope)
I am creating some JSON from some C++ datatypes, one of which is the char datatype. I would expect this to be treated as a JSON string, but when I call the dump method it outputs the value as if it were a JSON number.
nlohmann::json json;
char sample = 'a';
json["char"] = sample;
std::cout << json.dump ();
Expect the output to show : {"char":"a"}
The output I get is : {"char":97}
OS is Debian 9.3, compiler is g++ 6.3.0
develop
branch?Tag v3.1.2
The text was updated successfully, but these errors were encountered: