Question

As title says need to convert a Zip file to text file , no matter the size and no matter if it will make sense or not.But i need to reconvert it to that zip file again (Lose less). The main problem i am having is how to find a alternative text/number version of a character.

The Ascii wont work clearly ,So need help what can be a alternative text for a character specially that garbage looking binary chars in zip , when you see in a editor.

I am not a native English speaker , so i hope the above will make a sense to you guys :)

Was it helpful?

Solution

Look into Base 64 encoding. PHP has functions for this.

OTHER TIPS

I think what you are looking for is base64_encode and base64_decode. You can use those functions to convert any arbitrary binary data to text, then back to binary again.

Of course it has the side effect of increasing the size of the data by about 33%

Try using base64 encoding the zip file into a text file http://en.wikipedia.org/wiki/Base64

Sounds like you want to use uuencode, which basically converts binary data into an ASCII-transferale archive.
PHP also has base64_encode(), what most people would use here. And as last resort, there is also quoted_printable_encode()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top