I’ve tried searching around the dev forums for a specific answer on this, but I haven’t been able to make much sense of what little I found.
Suppose I have an array of integers between 0 and 127:
local array = {0, 6, 73, 13, 127, 12, 2, 0, 0, 23, ···}
This array is very large and rather than using JSON I would like to store it in a compressed format using strings. I should be able to encode this array very neatly as a string like so:
local output = ""
for i=1, #array do
output = output .. string.char(array[i])
end
print(output) --> \0\6\73\13\127 ···
What (if anything) should I look out for when working with these kinds of strings? I know that DataStores only accept UTF-8 for example, and that print() doesn’t work correctly with null characters (\0), but what about other functions in the standard library, or remote events, etc?