i'm querying a webservice in c# 4.0, which provides me with a string compressed by php's gzcompress(). Now i need to decompress this string in c#. I tried several ways including

but everytime i get an "Missing Magic Number" exception.

Can someone provide me with some hints?

Thank you

Edit 1:

My latest try:

public static string Decompress(string compressed) {
    byte[] compressedBytes = Encoding.ASCII.GetBytes(compressed);
    MemoryStream mem = new MemoryStream(compressedBytes);
    GZipStream gzip = new GZipStream(mem, CompressionMode.Decompress);
    StreamReader reader = new StreamReader(gzip);
    return reader.ReadToEnd();
}
Edit
Report