while scripting, i encountered a possible bug/flaw in llList2CSV and llCSV2List Functions.
They work fine, until you have a string with a comma inside the list. Basicly what happens is: If you turn List to CSV, you get a string seperated each object in the list with comma. Problem (and whats a bug in my eyes) is, thatt Strings aren't escaped (read: surrounded by " "
. Lets explain it on an example:
Lets say we have a list with [1, 2.22, 4, "My List", "Cat, Dog"]. Thats 5 elements. If i convert this to a string with llList2CSV, i get follow string "1, 2.22, 4, My List, Cat, Dog".
Now we can already see the problem here, we can't say anymore if "Cat, Dog" was once one object or two. If we convwert the same string to list again, we get the follow list [1, 2.22, 4, "My List", "Cat", "Dog"]. Notice the change? Right. The new list has 6 elements instead of 5.
The code below can be used to test it.
list liste = [1, 4, 1.1111, "One String", "String, with Comma"];
integer liste1size = llGetListLength(liste);
string strList1 = llList2CSV(liste);
llOwnerSay("Size of list: "+(string)liste1size+"\n"+strList1);
list liste2 = llCSV2List(strList1);
integer liste2size = llGetListLength(liste2);
string strList2 = llList2CSV(liste2);
llOwnerSay("Size of list2: "+(string)liste2size+"\n"+strList2);
prodcues follow output:
[6:00] Object: Size of list: 5
1, 4, 1.111100, One String, String, with Comma
[6:00] Object: Size of list2: 6
1, 4, 1.111100, One String, String, with Comma
Is there a workaround to prevent this, or an annoucned bugfix for this behaviour? It makes it pretty hard, to sync data with other objects, since only way to objects can communicate is via messages, which are strings indeed.
Anyone else had this problem and how did they worked around this?

