how to check if a string is valid gzdeflated string ?
Moderator: General Moderators
how to check if a string is valid gzdeflated string ?
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
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: how to check if a string is valid gzdeflated string ?
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.
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.