Json Parser Issue
under review
Extrude Ragu
default
{
state_entry()
{
string json_array = llList2Json(JSON_ARRAY, ["\"", "]"]);
string json_object = llList2Json(JSON_OBJECT,[
"string", "Hello, world!",
"json_array", json_array,
"double quote", "\""
]);
llSay(0, json_object);
string extracted_string = llJsonGetValue(json_object, ["string"]);
string extracted_array = llJsonGetValue(json_object, ["json_array"]);
llSay(0, "extracted_string:" + extracted_string); // Says "Hello, world!"
llSay(0, "extracted_array:" + extracted_array); // Empty string?
}
}
There seems to be an issue with the way llJsonGetValue extracts json arrays.
This minimal repro script gives an empty string for the extracted array, instead of the given array.
Note that the created json object seems fine, it just can't extract from it.
Log In
Otoa Kiyori
When I try to use llJsonGetValue() on a string that contains UTF-8 characters, it seems to return weird square sometimes also. I am guessing this is related to the known spec of this function related to "avoid using syntax characters" I am also guessing the string is expected to only have only part of first 128 characters in ASCII code.
Signal Linden
under review