mw99 / DataCompression

Swift libcompression wrapper as an extension for the Data type (GZIP, ZLIB, LZFSE, LZMA, LZ4, deflate, RFC-1950, RFC-1951, RFC-1952)
Apache License 2.0
286 stars 57 forks source link

compress array of json issue #28

Closed dsngeu closed 2 years ago

dsngeu commented 3 years ago

I am using gzip with Compression of array of json [{ }, {}, {}...] it compressed at iOS side and also decompress successfully at iOS side but when I upload compressed data to sever it fail to decompress. even it fails here. https://www.multiutil.com/text-to-gzip-compress/

I compress data and save it to document directory and then read compressed text then try to decompress text(array of json) by using https://www.multiutil.com/text-to-gzip-compress/ but it fails.

what could be issue?

mw99 commented 3 years ago

Maybe your web server automatically decompresses the data? Lot's of web servers detect deflate & gzip streams and decompress them automatically. Also why don't you use the gz tool on the command-line to compress/decompress? How about comparing the data you receive in a hex editor and see what you get instead?