Answer the question
In order to leave comments, you need to log in
How to solve encoding problem in php zip archive from ubuntu on windows?
I make a zip archive using php on ubuntu. On ubuntu everything is fine. I transfer to windows - there are bugs. Tried to recode in windows-1251. Displays the Cyrillic alphabet, but instead of the words "fiyimfuiaishchuksch" and other crap. How to solve the problem?
Answer the question
In order to leave comments, you need to log in
The Bandizip program helped me somehow , allowing you to choose the encoding of the source archive. I guess when unpacking, you need to select UTF-8 encoding.
7-zip uses cp866 encoding for Russian filenames added to a zip archive. Try it.
I encountered such a problem when I tried to archive files on FreeBSD that were on a mounted Windows ball. I did not find a solution, I had to cycle - I made several patches on tar :) and when archiving, it recoded the file names from koi8-r to whatever you say.
A long time ago I don’t work in that place, but the patches are preserved somewhere, if necessary - soap in the profile.
And what did you "try to recode"?
The only problem is that zip stores file names in a single-byte encoding, and on Russian Windows it is cp1251.
The contents of the files are archived in exactly the same way.
So it's enough not to name the archived files in Cyrillic.
> ZIP uses a default codepage of IBM437
> So it is impossible to create a ZIP file with non-ASCII filenames that work across different countries' releases of Windows and their built-in compressed folder support.
> If you need a non-ASCII archive format you'll have to use one of the newer formats, such as recent 7z or rar.
and also tar.gz packs in utf-8
just change the archiver
When you add files to the archive, use the change encoding function:
$charset = 'windows-1251'; // Для Windows
// ...
$zip->addfile($file, iconv($charset, '866//TRANSLIT', $file));
Well, here either look for some sliders on Jquery, or look for vertical scroll, or file it yourself, this is done by the following method - inside the block is absolutely positioned and with a length equal to all blocks, when you click on the arrow, it shifts horizontally and highlights the next element.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question