Parse reads some characters from ASCII Table as empty from json file #4622
Unanswered
fettahyildizz
asked this question in
Q&A
Replies: 1 comment
-
Can you provide a minimal working example of the reading and writing and the resulting json file? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a huge std::vector< float > object to dump. To reduce storage, I quantized float values between 0-255 and stored these values as unsigned char, then I dump std::vector< unsigned char > object as json.
I try to read my json object using nlohmann json library but non-printable characters are being loaded as empty, so I can't get back to float values using json object.
For example: Let's say I have a float value which is 0.005, then I quantize it between 0-255 and let's say quantized value is 50. I convert 20 to unsigned char and dump this value to json object. 20 in ASCII table is a non-printable character so when I read this value from json file, nlohmann reads it as empty. Data is missing.
I read my json object like this
When I print my json object, some values are empty so I can't get back original values since data is missing.
How can I read my json object which contains unsigned chars between 0-255 without making them empty?
Beta Was this translation helpful? Give feedback.
All reactions