My question is similar to here:
only, I get no result.
I gzipped the data in PHP:
$gztext = gzcompress($text,9);
var_dump(base64_encode($gztext));
and tried to decode in iOS:
NSString *encodedGzippedString = @"K0ktLlFIzSspqlTQ09MDYTCloKcApWEEGBkaGZuYAAA=";
NSData *decodedGzippedData = [NSData dataByBase64DecodingString:encodedGzippedString];
NSData *unGzippedJsonData = [decodedGzippedData gzipInflate];
if(unGzippedJsonData){
NSString* unGzippedJsonString = [[NSString alloc] initWithData:unGzippedJsonData encoding:NSASCIIStringEncoding];
if(unGzippedJsonString)
NSLog(@"Result: %@", unGzippedJsonString);
else
NSLog(@"string error");
}
else NSLog(@"gzip error");
The result is "gzip error"