Reputation: 3
I've been scouring the internet for a library or piece of code that will help me decompress an XFDL file with this type of encoding:application/x-xfdl;content-encoding="asc-gzip". All of the previous XFDL files I've dealt with have had this type of encoding: application/vnd.xfdl;content-encoding="base64-gzip", and I've had no problem using Base64 and GZIP (both libraries on github written by nicklockwood). I've found code in Python that would decompress these types of files, located here:http://www.ourada.org/blog/archives/375, but I'm at a loss as to how I would implement this code into an Objective-C project.
Any help at all or nudges in the right direction would be greatly appreciated.
Thank you!
Upvotes: 0
Views: 372
Reputation: 112284
The asc-gzip
examples I have found are actually zlib, then base-64 encoded. It is broken into blocks, with each block preceded by the compressed and uncompressed length in big-endian order, two bytes for each.
So to decode:
Interestingly, both "asc
" and "gzip
" are misnomers in the encoding name. asc
really means base 64, and gzip
really means zlib. Go figure.
Upvotes: 2