syntax error - invalid string: control character must be escaped; last read: '"ass<U+0000>'; expected string literal #2373
-
Hello, I am facing this issue as json std::string which i receive from server contains \u0000. while parsing i am getting exception. terminate called after throwing an instance of 'nlohmann::detail::parse_error' One strange thing is that, the same query when queried from the other application does not give the parsing error. So i am not sure whether to raise the bug on server side. Any lead would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
A JSON string must not contain control characters unless they are escaped with That is, a null byte in a string must be escaped like |
Beta Was this translation helpful? Give feedback.
A JSON string must not contain control characters unless they are escaped with
\
or via\uxxxx
:That is, a null byte in a string must be escaped like
\u0000
. I think your server may be too lax on this - or the null byte is the symptom of a bigger issue.