K
K
KoRNeT46RuS2016-10-25 13:53:30
linux
KoRNeT46RuS, 2016-10-25 13:53:30

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

8 answer(s)
R
Roman Mirilaczvili, 2016-10-25
@2ord

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.

S
SagePtr, 2016-10-25
@SagePtr

7-zip uses cp866 encoding for Russian filenames added to a zip archive. Try it.

C
CityCat4, 2016-10-25
@CityCat4

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.

A
Adamos, 2016-10-25
@Adamos

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.

R
romy4, 2016-10-25
@romy4

> 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

S
Sergei Iamskoi, 2016-10-25
@syamskoy

When you add files to the archive, use the change encoding function:

$charset = 'windows-1251'; // Для Windows
// ...
$zip->addfile($file, iconv($charset, '866//TRANSLIT', $file));

or me archiver.

A
Alexander Belov, 2016-12-17
@AlexanderBelov

joshreed.github.io/jQuery-ScrollTabs

P
Pavel Belyaev, 2016-12-17
@PavelBelyaev

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 question

Ask a Question

731 491 924 answers to any question