K
K
Konstantin Kandaurov2016-05-18 16:04:35
Data archiving
Konstantin Kandaurov, 2016-05-18 16:04:35

Why is a zip file with a password with Russian characters not decompressed by 7-zip?

Faced such a problem: They sent a zip archive by mail, compressed using the archiver built into windows 7 and password-protected in Russian letters. 7-zip swears that the password is wrong. Although the archiver built into the OS, the files are unpacked without problems. When trying to compress arbitrary files using 7-zip in zip format with a "Russian" password, it gives an error: Enter only Latin characters. What is the problem with this archive and why is 7-zip not "friends" with it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
drc, 2016-05-18
@drc

Most likely it's the encoding, windows 7 uses Windows-1251, and 7z uses Unicode

Y
Yuri Chudnovsky, 2016-05-19
@Frankenstine

You should use the Unicode features of the ZipArchive Library when the filenames, comments or passwords in the archives you use contain non-ASCII characters.
Without the Unicode support, the strings in archives are stored under Windows using the following code page:
filenames - current system OEM code page (CP_OEMCP),
comments, passwords - current system ANSI code page (CP_ACP).
Under other platforms, all strings are stored using the current system's code page.
To use the Unicode functionality under Windows, you should compile the library and your application for Unicode. Under systems that use Unicode UTF-8 as the default code page (like Linux and OS X), there are no special considerations needed. On other systems, the Unicode support is not available.

Obviously, Microsoft programmers did not read these recommendations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question