In order to create a CSV string from a list, the following operations must be performed on each element of the list:
") then the double quotes must be escaped by pre-pending another double quote.
And spaces are considered to be part of the data, however, many implementations treat the following cases differently:
is sometimes encoded to a list containing the elements:
in broken implementations, such as LSL's
llCSV2List while some implementations (those closer to RFC 4180) encode the string to a list containing the elements:
with the space preceding
In order to pacify the situation, we add an extra requirement for our encoders that list elements that contain spaces must be escaped with double-quotes. This does not break anything because RFC 4180 states that "5. Each field may or may not be enclosed in double quotes […]" which makes an quote-enclosed string such as
"Hello" equivalent to
Hello with or without the quotes.