I'm trying to send an image over a network using LUBE. I thought the best way to do it would be to send the imagedata as a string then convert it back on the other end, but I'm having some issues. When I convert an image to imagedata, it's all good, but when I change the imagedata to a string, it's encoded in UTF-8, which I suppose Lua doesn't like. If I try to print the string, I get an error complaining about the encoding being invalid, and if I try to error with the string as an argument (my common way of checking variabe values at a certain point in code), the app crashes.
I'm not very knowledgeable about the subject, but I believe this can be fixed by converting the UTF-8 string to an ASCII string and sending that, but I don't know how to do it. Furthermore, I'm confused about why L2D would convert the imagedata to UTF-8 in the first place, considering that there doesn't appear to be any way to use the returned string without first converting it. I've attached a proof-of-concept .love below; it's pretty straight forward. Check it out and let me know if you have insight into how I can get the returned string into a viewable format.
Side-note: is there any better way to see variable values at a specific time without using error(x) or assert(nil, x)?
Thanks!
