tags:

views:

97

answers:

4

When compressing a string "stream" the '/r' gets stripped out from '/r/n'. I am using the ICSharp.zip library for compression. Has any one else faced this problem, and if you have is there is a workaround?

+1  A: 

Does your zip library have a parameter to treat the stream as either text or binary? It sounds like it's treating it as text and is changing the line-end delimiter (some apps do this to try and make sure it matches the target platform). If you can tell it to treat the data as binary it might help.

Herms
A: 

Thank You Herms, I'll give that a try.

A: 

I had the same issue with that library, can you confirm Herms suggestion? It'd be sweet. I had to resort to batch filing with 7-Zip for my solution because I didn't have the funds to pay for a compression library on that project.

A: 

Try DotNetZip.
It's a managed-code library, doesn't have problems with CR/LF translation. fee. open source.

DotNetZip on CodePlex

Cheeso