As naive as this is going to sound, I have to ask it.

I have a stream compressed in LZW encoding. I can decompress a stream provided it is in a numerical format. The below I have extracted from a pdf file stream compressed in LZW.

I'm assuming the below is a text representation of the binary data. I read the compressed stream directly into a text file

(ifstream mystream(myfile.txt, ios::out | ios::binary)

and did not save the text file in any way.

If I can extract the data as I have below, then how do I get it into a numerical form so I can run it through my LZW decompression algorithm? I know some streams are also compresse using ASCII85 but this one isn't. Obviously this is a huge gap in my knowledge but I'm getting there. Was wondering if someone could give me a hint as to what I need to look at here. Thanks.

åBߣán3∟♂åâA☺P₧Te0pT``0ö§♀u
╢;((¿*»ìF│┴╜─@l►¶εÉï╜|èT┴▌»
9¥%F←¥ô ï╞π═µ#V'♂î←╧D↓╝ε[§_▲☼3┘üyP≥p2├
♠‼9ùW_↨∞σFπáéÖ<)m±é≥iö╚i0Éìτü☺nÑj₧♫♠#☻P/)←╬å‼ª─a╓∞↓Nf≤⌐╚╟Γ¼╣G

First of all.. What does the file contain? I have no experience in this file format, but, I'm sure there will be some tutorials out there on the header and how to handle the format. If it's numerical, 8bit, 16bit, etc.. You have to handle these. Read the file into a char array and then try conversion methods.

As mentioned it's a pdf. The stream is compressed in LZW.
A decimal representation of this data also gives me negative numbers when loading each charcter into an integer container like a vector? I wasn't aware there were negative numbers in LZW encoding? Given that, what could be the issue?

Edited 3 Years Ago by daino

Unsigned chars..please forget I asked that.
Think I need to give this a rest for a while.

there are various questions that comes to mind.
1. how was the main file written? ie. is it encrypted ?
-if yes, you will need the encrypted key/pass to get the real data.
- if no, then you must know how to use the compressed lib verywell to use it to decompress the data which i think its not possible...
why because his encryption might be done on Nth times. Datas are encrypted to keep people like you not to poke their noses into peoples secrets else no need for that at all. got it?

Well, it's not me pokin my nose into things. It's a pdf file stream encoded only in LZW.

This article has been dead for over six months. Start a new discussion instead.