A
A
Artyom2014-12-07 17:15:25
PHP
Artyom, 2014-12-07 17:15:25

How to unzip an archive created under Windows on a Linux server?

Hello!
Please help if you know how.
I create an archive under Win 8. The archive contains Cyrillic names. I upload it to the server, and there it should unpack. But when unzipping, Cyrillic names turn into a bunch of hieroglyphs.
I tried to create zip, 7z, rar archives and unzip them with different methods. Used the PCLZIP library ( www.phpconcept.net/pclzip/) and the exec function:
exec('unrar archive.rar');
exec('unzip archive.zip');
exec('unzip -O utf8 archive.zip');

exec('unzip archive.zip');
exec('convmv -f cp1252 -t cp850 -r * --notest');
exec('convmv -f cp866 -t utf-8 -r * --notest');

exec('unzip -O cp850 archive.zip');
exec('convmv -f cp866 -t utf-8 -r * --notest');

Nothing works, at best, some of the folders will be renamed and the files will be renamed to Cyrillic, but some will not.
Tell me how you can properly unzip the archive with Cyrillic?
Or what are alternative methods of archiving on Win 8 with adequate unzipping on the server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2014-12-07
@Nc_Soft

Have you tried tar.gz?

N
Nazar Mokrinsky, 2014-12-07
@nazarpc

1) Try it without a library, Phar's built-in support allows you to unpack tar, tar.gz, tar.bz2, zip archives (but the speed will be lower, for several megabytes it's not critical, for large files it may not be suitable)
2) Try tar, it will most likely be faster and easiest, tar.bz2 if you need to compress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question