11-21-2023 02:54 AM
I am using Labview community on a Ubuntu linux system.
When working with Json flatten to string the flatten fails with:
putting brackets and braces in the text adds \00.
Any solution on this?
11-21-2023 04:20 AM
Hi Hartmut,
I don't know if the JSON functions have a special behavior in Linux systems, but how did you create your JSON string in first place ?
What data type do you flatten / unflatten ? We need some code example to understand what you are trying to do.
Here is an example of the flattening of a cluster containing a string "data" with brackets in its value:
Regards,
Raphaël.
11-21-2023 05:04 AM - edited 11-21-2023 05:06 AM
I find the JSON primitives lacking in many ways. Use the JSONtext library by JDP Science. It is far and away the best JSON library out there. It is freely available through VIPM. I haven't tried it myself, but I'm pretty sure it will work on Linux.
11-21-2023 01:09 PM
Assuming the string being shown has '\' Codes Display enabled and the string has an actual null (\00) character as a whitespace token, the string is an invalid JSON string.
In the JSON snippet {"data":[]} the only whitespace characters allowed between the : and the opening [ are space, tab, and the newline characters.
See the definition of whitespace on json.org: https://www.json.org/json-en.html
So whatever is generating the JSON string using the null character as a whitespace character is generating invalid JSON.