C# String Compression

I need to compress (zip or any other way is ok) a string, send it to a php’s page so that it is saved on the server and to do that another client can download and decompress it. Do you know if there are some example/library or another thing to compress/decompress in c# with Unity?
I need it for webplayer, so I can’t use filesystem.

Is System.IO.Compression not available in webplayer or something?

It’s not necessarily filesystem.

Here’s a stack overflow thread on it:
http://stackoverflow.com/questions/7343465/compression-decompression-string-with-c-sharp

You could also write your own if that doesn’t work.

Here’s one in C:

http://forum.unity3d.com/threads/152579-LZF-compression-and-decompression-for-Unity

–Eric

I tried 2 different systems from your first link, but I have this error:

Thank you. It seems to be perfect as system but I need to transform in string in order to send to php. In this case I have a byte [ ]. How can I transform all without any problem?

You can convert the string to a byte array: System.Text.Encoding.UTF8.GetBytes (myString);

–Eric

I have a problem, I use this:

Error:

Can you help me? :slight_smile:

I have the same issue…