Page 1 of 1
how to check if a string is valid gzdeflated string ?
Posted: Wed Sep 09, 2009 12:17 pm
by madrazel
the problem is that gzdeflate function does not return false when there is an error with the string, that is if in example this string was compressed with another compressor not compatible with gzdeflate or is just a random string without any information contained
Re: how to check if a string is valid gzdeflated string ?
Posted: Wed Sep 09, 2009 1:18 pm
by John Cartwright
There are different implementations of gzip, so you need to make sure your gzip is using the same compression algorithm.
For instance, if you are trying to decode an HTTP gzip'd response, you'll want to use gzuncompress (HTTP and gzuncompress both use zlib).
I'm not expert on the matter, but I would suspect this is why no error is being triggered.