compression and encoding ported to 3.3.2

problem with different encodings is left