F
F
Fedcomp2012-01-28 10:12:15
Gzip
Fedcomp, 2012-01-28 10:12:15

gzip strings without nullbytes

Hello residents of habr.
Perhaps someone will find the question strange / stupid,
but is it possible to gzip the string somehow so that the zipped result is without null bytes?
is it possible by the algorithm itself?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zapimir, 2012-01-29
@Fedcomp

The standard does not provide for this, moreover, there will most likely be zero bytes in the header, and in the compressed content itself.
www.gzip.org/zlib/rfc-gzip.html
In principle, in my opinion, not one archiver bothers with null bytes.
And what's the problem? Maybe you can solve it differently.

Z
zapimir, 2012-01-28
@zapimir

Only manually, since there will be zero bytes at least at the end, there is a size of 4 bytes. Encode to base64, or escape the desired characters after gzip.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question